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

Percentage Accurate: 95.5% → 98.6%
Time: 28.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.6% accurate, 0.1× speedup?

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

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


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

    1. Initial program 97.9%

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

    if 5.0000000000000004e96 < (*.f64 (*.f64 y 9) z)

    1. Initial program 90.9%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative90.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. cancel-sign-sub-inv90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    4. Step-by-step derivation
      1. fma-udef96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.2% accurate, 0.1× speedup?

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

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


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

    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 \]

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

    1. Initial program 65.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.1% accurate, 0.7× speedup?

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

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


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

    1. Initial program 97.9%

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

    if 5.0000000000000004e96 < (*.f64 (*.f64 y 9) z)

    1. Initial program 90.9%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative90.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. cancel-sign-sub-inv90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 96.5% accurate, 0.9× speedup?

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

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


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

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    8. Applied rewrite-once18.6%

      \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log51.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0 + \left(-9 \cdot \left(t \cdot y\right)\right) \cdot z} \]
    13. Step-by-step derivation
      1. +-lft-identity55.2%

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

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

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

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

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

    if -1.2800000000000001e73 < z

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot 2 - \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 simplification88.5%

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

Alternative 5: 80.1% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.19999999999999981e65 or 2.1000000000000001e-37 < x

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.19999999999999981e65 < x < 2.1000000000000001e-37

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 45.9% accurate, 1.1× speedup?

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

\mathbf{elif}\;t \leq 4.4 \cdot 10^{-67}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 0.000165:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;t \leq 8 \cdot 10^{+117}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.4999999999999999e-297 or 4.4000000000000002e-67 < t < 1.65e-4

    1. Initial program 96.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative96.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. cancel-sign-sub-inv96.0%

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

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

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

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

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

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

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

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

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

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

    if -3.4999999999999999e-297 < t < 4.4000000000000002e-67 or 1.65e-4 < t < 8.0000000000000004e117

    1. Initial program 97.2%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.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. cancel-sign-sub-inv97.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      3. metadata-eval44.1%

        \[\leadsto \left(a \cdot \color{blue}{\left(--27\right)}\right) \cdot b \]
      4. distribute-rgt-neg-in44.1%

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

        \[\leadsto \color{blue}{b \cdot \left(-a \cdot -27\right)} \]
      6. distribute-rgt-neg-in44.1%

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

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

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

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

    if 8.0000000000000004e117 < t

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

        \[\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. +-commutative93.1%

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    8. Applied rewrite-once35.8%

      \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log70.4%

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

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

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

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

Alternative 7: 50.9% accurate, 1.1× speedup?

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

\mathbf{elif}\;z \leq 3.3 \cdot 10^{-177}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.82 \cdot 10^{-87}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    4. Step-by-step derivation
      1. fma-udef93.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.75e-42 < z < 3.3e-177 or 2.5000000000000001e-116 < z < 1.81999999999999993e-87

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot \left(9 \cdot z\right)\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b} \]
    4. Taylor expanded in x around 0 67.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. cancel-sign-sub-inv67.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot \color{blue}{\left(--27\right)}\right) \cdot b \]
      4. distribute-rgt-neg-in50.2%

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

        \[\leadsto \color{blue}{b \cdot \left(-a \cdot -27\right)} \]
      6. distribute-rgt-neg-in50.2%

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

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

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

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

    if 3.3e-177 < z < 2.5000000000000001e-116

    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. cancel-sign-sub-inv99.7%

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

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

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

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

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

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

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

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

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

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

    if 1.81999999999999993e-87 < z

    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. +-commutative95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    8. Applied rewrite-once25.3%

      \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log58.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.75 \cdot 10^{-42}:\\ \;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-177}:\\ \;\;\;\;\left(a \cdot 27\right) \cdot b\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-116}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 1.82 \cdot 10^{-87}:\\ \;\;\;\;\left(a \cdot 27\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\ \end{array} \]

Alternative 8: 51.0% accurate, 1.1× speedup?

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

\mathbf{elif}\;z \leq 2.25 \cdot 10^{-180}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 3.55 \cdot 10^{-88}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    8. Applied rewrite-once16.9%

      \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log49.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0 - \color{blue}{\left(9 \cdot \left(y \cdot t\right)\right) \cdot z} \]
      9. cancel-sign-sub-inv51.8%

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

        \[\leadsto 0 + \left(-9 \cdot \color{blue}{\left(t \cdot y\right)}\right) \cdot z \]
    12. Applied egg-rr51.8%

      \[\leadsto \color{blue}{0 + \left(-9 \cdot \left(t \cdot y\right)\right) \cdot z} \]
    13. Step-by-step derivation
      1. +-lft-identity51.8%

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

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

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

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

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

    if -1.46e-37 < z < 2.25000000000000005e-180 or 2.5000000000000001e-116 < z < 3.55e-88

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot \left(9 \cdot z\right)\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b} \]
    4. Taylor expanded in x around 0 66.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. cancel-sign-sub-inv66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot \color{blue}{\left(--27\right)}\right) \cdot b \]
      4. distribute-rgt-neg-in49.6%

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

        \[\leadsto \color{blue}{b \cdot \left(-a \cdot -27\right)} \]
      6. distribute-rgt-neg-in49.6%

        \[\leadsto b \cdot \color{blue}{\left(a \cdot \left(--27\right)\right)} \]
      7. metadata-eval49.6%

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

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

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

    if 2.25000000000000005e-180 < z < 2.5000000000000001e-116

    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. cancel-sign-sub-inv99.7%

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

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

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

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

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

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

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

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

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

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

    if 3.55e-88 < z

    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. +-commutative95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    8. Applied rewrite-once25.3%

      \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log58.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.46 \cdot 10^{-37}:\\ \;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{-180}:\\ \;\;\;\;\left(a \cdot 27\right) \cdot b\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-116}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{-88}:\\ \;\;\;\;\left(a \cdot 27\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\ \end{array} \]

Alternative 9: 51.0% accurate, 1.1× speedup?

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

\mathbf{elif}\;z \leq 5.2 \cdot 10^{-179}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 5.2 \cdot 10^{-88}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    8. Applied rewrite-once16.9%

      \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log49.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0 - \color{blue}{\left(9 \cdot \left(y \cdot t\right)\right) \cdot z} \]
      9. cancel-sign-sub-inv51.8%

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

        \[\leadsto 0 + \left(-9 \cdot \color{blue}{\left(t \cdot y\right)}\right) \cdot z \]
    12. Applied egg-rr51.8%

      \[\leadsto \color{blue}{0 + \left(-9 \cdot \left(t \cdot y\right)\right) \cdot z} \]
    13. Step-by-step derivation
      1. +-lft-identity51.8%

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

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

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

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

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

    if -4.19999999999999987e-39 < z < 5.20000000000000011e-179 or 2.8999999999999998e-116 < z < 5.20000000000000027e-88

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot \left(9 \cdot z\right)\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b} \]
    4. Taylor expanded in x around 0 67.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. cancel-sign-sub-inv67.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot \color{blue}{\left(--27\right)}\right) \cdot b \]
      4. distribute-rgt-neg-in50.2%

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

        \[\leadsto \color{blue}{b \cdot \left(-a \cdot -27\right)} \]
      6. distribute-rgt-neg-in50.2%

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

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

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

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

    if 5.20000000000000011e-179 < z < 2.8999999999999998e-116

    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. cancel-sign-sub-inv99.7%

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

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

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

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

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

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

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

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

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

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

    if 5.20000000000000027e-88 < z

    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. +-commutative95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{-39}:\\ \;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{-179}:\\ \;\;\;\;\left(a \cdot 27\right) \cdot b\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-116}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{-88}:\\ \;\;\;\;\left(a \cdot 27\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot -9\right) \cdot \left(y \cdot z\right)\\ \end{array} \]

Alternative 10: 78.7% accurate, 1.1× speedup?

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

    1. Initial program 95.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative95.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. cancel-sign-sub-inv95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.89999999999999974e-33 < z < 5.7e-111

    1. Initial program 98.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. +-commutative98.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. cancel-sign-sub-inv98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-x \cdot \left(x \cdot 4\right)\right) - {\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*30.5%

        \[\leadsto \frac{\left(-\color{blue}{\left(x \cdot x\right) \cdot 4}\right) - {\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} \]
    8. Simplified30.5%

      \[\leadsto \color{blue}{\frac{\left(-\left(x \cdot x\right) \cdot 4\right) - {\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
    9. Step-by-step derivation
      1. div-sub30.5%

        \[\leadsto \color{blue}{\frac{-\left(x \cdot x\right) \cdot 4}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} - \frac{{\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
      2. frac-2neg30.5%

        \[\leadsto \color{blue}{\frac{-\left(-\left(x \cdot x\right) \cdot 4\right)}{-\left(-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)\right)}} - \frac{{\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} \]
      3. remove-double-neg30.5%

        \[\leadsto \frac{-\left(-\left(x \cdot x\right) \cdot 4\right)}{\color{blue}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} - \frac{{\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} \]
      4. frac-2neg30.5%

        \[\leadsto \frac{-\left(-\left(x \cdot x\right) \cdot 4\right)}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} - \color{blue}{\frac{-{\left(b \cdot a\right)}^{2} \cdot -729}{-\left(-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)\right)}} \]
      5. remove-double-neg30.5%

        \[\leadsto \frac{-\left(-\left(x \cdot x\right) \cdot 4\right)}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} - \frac{-{\left(b \cdot a\right)}^{2} \cdot -729}{\color{blue}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
      6. sub-div30.5%

        \[\leadsto \color{blue}{\frac{\left(-\left(-\left(x \cdot x\right) \cdot 4\right)\right) - \left(-{\left(b \cdot a\right)}^{2} \cdot -729\right)}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
    10. Applied egg-rr84.3%

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

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

Alternative 11: 76.1% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    8. Applied rewrite-once17.1%

      \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log49.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0 - \color{blue}{\left(9 \cdot \left(y \cdot t\right)\right) \cdot z} \]
      9. cancel-sign-sub-inv52.5%

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

        \[\leadsto 0 + \left(-9 \cdot \color{blue}{\left(t \cdot y\right)}\right) \cdot z \]
    12. Applied egg-rr52.5%

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

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

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

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

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

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

    if -4.60000000000000022e-34 < z < 3.7000000000000001e-11

    1. Initial program 99.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. +-commutative99.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. cancel-sign-sub-inv99.0%

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

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

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

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

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

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

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

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

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

    if 3.7000000000000001e-11 < z

    1. Initial program 93.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. +-commutative93.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. cancel-sign-sub-inv93.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    8. Applied rewrite-once27.5%

      \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log62.7%

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

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

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

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

Alternative 12: 76.1% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    8. Applied rewrite-once17.1%

      \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log49.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0 - \color{blue}{\left(9 \cdot \left(y \cdot t\right)\right) \cdot z} \]
      9. cancel-sign-sub-inv52.5%

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

        \[\leadsto 0 + \left(-9 \cdot \color{blue}{\left(t \cdot y\right)}\right) \cdot z \]
    12. Applied egg-rr52.5%

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

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

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

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

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

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

    if -1.3999999999999999e-31 < z < 5.00000000000000018e-11

    1. Initial program 99.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. +-commutative99.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. cancel-sign-sub-inv99.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\left(2 \cdot x\right) \cdot \left(2 \cdot x\right)}{-\left(2 \cdot x - 27 \cdot \left(a \cdot b\right)\right)} - \color{blue}{\frac{-\left(27 \cdot \left(a \cdot b\right)\right) \cdot \left(27 \cdot \left(a \cdot b\right)\right)}{-\left(2 \cdot x - 27 \cdot \left(a \cdot b\right)\right)}} \]
      5. sub-div31.9%

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

      \[\leadsto \color{blue}{\frac{\left(-x \cdot \left(x \cdot 4\right)\right) - {\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*31.9%

        \[\leadsto \frac{\left(-\color{blue}{\left(x \cdot x\right) \cdot 4}\right) - {\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} \]
    8. Simplified31.9%

      \[\leadsto \color{blue}{\frac{\left(-\left(x \cdot x\right) \cdot 4\right) - {\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
    9. Step-by-step derivation
      1. div-sub31.9%

        \[\leadsto \color{blue}{\frac{-\left(x \cdot x\right) \cdot 4}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} - \frac{{\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
      2. frac-2neg31.9%

        \[\leadsto \color{blue}{\frac{-\left(-\left(x \cdot x\right) \cdot 4\right)}{-\left(-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)\right)}} - \frac{{\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} \]
      3. remove-double-neg31.9%

        \[\leadsto \frac{-\left(-\left(x \cdot x\right) \cdot 4\right)}{\color{blue}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} - \frac{{\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} \]
      4. frac-2neg31.9%

        \[\leadsto \frac{-\left(-\left(x \cdot x\right) \cdot 4\right)}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} - \color{blue}{\frac{-{\left(b \cdot a\right)}^{2} \cdot -729}{-\left(-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)\right)}} \]
      5. remove-double-neg31.9%

        \[\leadsto \frac{-\left(-\left(x \cdot x\right) \cdot 4\right)}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} - \frac{-{\left(b \cdot a\right)}^{2} \cdot -729}{\color{blue}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
      6. sub-div31.9%

        \[\leadsto \color{blue}{\frac{\left(-\left(-\left(x \cdot x\right) \cdot 4\right)\right) - \left(-{\left(b \cdot a\right)}^{2} \cdot -729\right)}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
    10. Applied egg-rr79.1%

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

    if 5.00000000000000018e-11 < z

    1. Initial program 93.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. +-commutative93.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. cancel-sign-sub-inv93.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    8. Applied rewrite-once27.5%

      \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log62.7%

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

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

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

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

Alternative 13: 76.2% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 94.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. +-commutative94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    8. Applied rewrite-once17.3%

      \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log50.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0 - \color{blue}{\left(9 \cdot \left(y \cdot t\right)\right) \cdot z} \]
      9. cancel-sign-sub-inv53.1%

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

        \[\leadsto 0 + \left(-9 \cdot \color{blue}{\left(t \cdot y\right)}\right) \cdot z \]
    12. Applied egg-rr53.1%

      \[\leadsto \color{blue}{0 + \left(-9 \cdot \left(t \cdot y\right)\right) \cdot z} \]
    13. Step-by-step derivation
      1. +-lft-identity53.1%

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

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

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

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

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

    if -2.49999999999999986e-30 < z < 9.49999999999999951e-11

    1. Initial program 99.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. +-commutative99.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. cancel-sign-sub-inv99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-x \cdot \left(x \cdot 4\right)\right) - {\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*32.5%

        \[\leadsto \frac{\left(-\color{blue}{\left(x \cdot x\right) \cdot 4}\right) - {\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} \]
    8. Simplified32.5%

      \[\leadsto \color{blue}{\frac{\left(-\left(x \cdot x\right) \cdot 4\right) - {\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
    9. Step-by-step derivation
      1. div-sub32.5%

        \[\leadsto \color{blue}{\frac{-\left(x \cdot x\right) \cdot 4}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} - \frac{{\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
      2. frac-2neg32.5%

        \[\leadsto \color{blue}{\frac{-\left(-\left(x \cdot x\right) \cdot 4\right)}{-\left(-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)\right)}} - \frac{{\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} \]
      3. remove-double-neg32.5%

        \[\leadsto \frac{-\left(-\left(x \cdot x\right) \cdot 4\right)}{\color{blue}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} - \frac{{\left(b \cdot a\right)}^{2} \cdot -729}{-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} \]
      4. frac-2neg32.5%

        \[\leadsto \frac{-\left(-\left(x \cdot x\right) \cdot 4\right)}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} - \color{blue}{\frac{-{\left(b \cdot a\right)}^{2} \cdot -729}{-\left(-\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)\right)}} \]
      5. remove-double-neg32.5%

        \[\leadsto \frac{-\left(-\left(x \cdot x\right) \cdot 4\right)}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)} - \frac{-{\left(b \cdot a\right)}^{2} \cdot -729}{\color{blue}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
      6. sub-div32.5%

        \[\leadsto \color{blue}{\frac{\left(-\left(-\left(x \cdot x\right) \cdot 4\right)\right) - \left(-{\left(b \cdot a\right)}^{2} \cdot -729\right)}{\mathsf{fma}\left(2, x, a \cdot \left(b \cdot -27\right)\right)}} \]
    10. Applied egg-rr79.3%

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

    if 9.49999999999999951e-11 < z

    1. Initial program 93.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. +-commutative93.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. cancel-sign-sub-inv93.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    8. Applied rewrite-once27.5%

      \[\leadsto \color{blue}{e^{\log \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot -9\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log62.7%

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

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

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

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

Alternative 14: 48.1% accurate, 1.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.8000000000000003e65 or 2.20000000000000002e-37 < x

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8000000000000003e65 < x < 2.20000000000000002e-37

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 48.0% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.5000000000000005e65 or 8.1999999999999996e-38 < x

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot \left(9 \cdot z\right)\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b} \]
    4. Taylor expanded in x around inf 50.7%

      \[\leadsto \color{blue}{2 \cdot x} \]

    if -9.5000000000000005e65 < x < 8.1999999999999996e-38

    1. Initial program 96.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative96.1%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. cancel-sign-sub-inv96.1%

        \[\leadsto \left(a \cdot 27\right) \cdot b + \color{blue}{\left(x \cdot 2 + \left(-\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      3. associate-+r+96.1%

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-\left(y \cdot 9\right) \cdot z\right) \cdot t} \]
      4. distribute-rgt-neg-out96.1%

        \[\leadsto \left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \color{blue}{\left(\left(y \cdot 9\right) \cdot \left(-z\right)\right)} \cdot t \]
      5. *-commutative96.1%

        \[\leadsto \left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \color{blue}{\left(\left(-z\right) \cdot \left(y \cdot 9\right)\right)} \cdot t \]
      6. associate-*l*97.5%

        \[\leadsto \left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \color{blue}{\left(-z\right) \cdot \left(\left(y \cdot 9\right) \cdot t\right)} \]
      7. cancel-sign-sub-inv97.5%

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) - z \cdot \left(\left(y \cdot 9\right) \cdot t\right)} \]
      8. *-commutative97.5%

        \[\leadsto \left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) - \color{blue}{\left(\left(y \cdot 9\right) \cdot t\right) \cdot z} \]
      9. associate-+r-97.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. +-commutative97.5%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot t\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b} \]
    3. Simplified96.1%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot \left(9 \cdot z\right)\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b} \]
    4. Taylor expanded in x around 0 86.5%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv86.5%

        \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) + \left(-9\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
      2. +-commutative86.5%

        \[\leadsto \color{blue}{\left(-9\right) \cdot \left(t \cdot \left(y \cdot z\right)\right) + 27 \cdot \left(a \cdot b\right)} \]
      3. metadata-eval86.5%

        \[\leadsto \color{blue}{-9} \cdot \left(t \cdot \left(y \cdot z\right)\right) + 27 \cdot \left(a \cdot b\right) \]
      4. *-commutative86.5%

        \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 27 \cdot \left(a \cdot b\right) \]
      5. *-commutative86.5%

        \[\leadsto \color{blue}{\left(\left(y \cdot z\right) \cdot t\right)} \cdot -9 + 27 \cdot \left(a \cdot b\right) \]
      6. associate-*r*86.4%

        \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(t \cdot -9\right)} + 27 \cdot \left(a \cdot b\right) \]
      7. associate-*l*85.5%

        \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(t \cdot -9\right)\right)} + 27 \cdot \left(a \cdot b\right) \]
      8. *-commutative85.5%

        \[\leadsto y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + 27 \cdot \color{blue}{\left(b \cdot a\right)} \]
      9. associate-*r*85.6%

        \[\leadsto y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + \color{blue}{\left(27 \cdot b\right) \cdot a} \]
      10. *-commutative85.6%

        \[\leadsto y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    6. Applied egg-rr85.6%

      \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    7. Taylor expanded in z around 0 85.6%

      \[\leadsto y \cdot \color{blue}{\left(-9 \cdot \left(t \cdot z\right)\right)} + a \cdot \left(27 \cdot b\right) \]
    8. Step-by-step derivation
      1. *-commutative85.6%

        \[\leadsto y \cdot \left(-9 \cdot \color{blue}{\left(z \cdot t\right)}\right) + a \cdot \left(27 \cdot b\right) \]
      2. associate-*l*85.6%

        \[\leadsto y \cdot \color{blue}{\left(\left(-9 \cdot z\right) \cdot t\right)} + a \cdot \left(27 \cdot b\right) \]
      3. *-commutative85.6%

        \[\leadsto y \cdot \color{blue}{\left(t \cdot \left(-9 \cdot z\right)\right)} + a \cdot \left(27 \cdot b\right) \]
      4. *-commutative85.6%

        \[\leadsto y \cdot \left(t \cdot \color{blue}{\left(z \cdot -9\right)}\right) + a \cdot \left(27 \cdot b\right) \]
    9. Simplified85.6%

      \[\leadsto y \cdot \color{blue}{\left(t \cdot \left(z \cdot -9\right)\right)} + a \cdot \left(27 \cdot b\right) \]
    10. Taylor expanded in y around 0 46.7%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    11. Step-by-step derivation
      1. associate-*r*46.7%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} \]
      2. *-commutative46.7%

        \[\leadsto \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      3. metadata-eval46.7%

        \[\leadsto \left(a \cdot \color{blue}{\left(--27\right)}\right) \cdot b \]
      4. distribute-rgt-neg-in46.7%

        \[\leadsto \color{blue}{\left(-a \cdot -27\right)} \cdot b \]
      5. *-commutative46.7%

        \[\leadsto \color{blue}{b \cdot \left(-a \cdot -27\right)} \]
      6. distribute-rgt-neg-in46.7%

        \[\leadsto b \cdot \color{blue}{\left(a \cdot \left(--27\right)\right)} \]
      7. metadata-eval46.7%

        \[\leadsto b \cdot \left(a \cdot \color{blue}{27}\right) \]
      8. *-commutative46.7%

        \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} \]
    12. Simplified46.7%

      \[\leadsto \color{blue}{b \cdot \left(27 \cdot a\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.5 \cdot 10^{+65}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{-38}:\\ \;\;\;\;\left(a \cdot 27\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 16: 31.5% accurate, 5.7× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ x \cdot 2 \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	return x * 2.0;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * 2.0d0
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * 2.0;
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	return x * 2.0
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	return Float64(x * 2.0)
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp = code(x, y, z, t, a, b)
	tmp = x * 2.0;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
x \cdot 2
\end{array}
Derivation
  1. Initial program 96.4%

    \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
  2. Step-by-step derivation
    1. +-commutative96.4%

      \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
    2. cancel-sign-sub-inv96.4%

      \[\leadsto \left(a \cdot 27\right) \cdot b + \color{blue}{\left(x \cdot 2 + \left(-\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
    3. associate-+r+96.4%

      \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-\left(y \cdot 9\right) \cdot z\right) \cdot t} \]
    4. distribute-rgt-neg-out96.4%

      \[\leadsto \left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \color{blue}{\left(\left(y \cdot 9\right) \cdot \left(-z\right)\right)} \cdot t \]
    5. *-commutative96.4%

      \[\leadsto \left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \color{blue}{\left(\left(-z\right) \cdot \left(y \cdot 9\right)\right)} \cdot t \]
    6. associate-*l*96.0%

      \[\leadsto \left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \color{blue}{\left(-z\right) \cdot \left(\left(y \cdot 9\right) \cdot t\right)} \]
    7. cancel-sign-sub-inv96.0%

      \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) - z \cdot \left(\left(y \cdot 9\right) \cdot t\right)} \]
    8. *-commutative96.0%

      \[\leadsto \left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) - \color{blue}{\left(\left(y \cdot 9\right) \cdot t\right) \cdot z} \]
    9. associate-+r-96.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. +-commutative96.0%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot t\right) \cdot z\right) + \left(a \cdot 27\right) \cdot b} \]
  3. Simplified96.4%

    \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot \left(9 \cdot z\right)\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b} \]
  4. Taylor expanded in x around inf 30.8%

    \[\leadsto \color{blue}{2 \cdot x} \]
  5. Final simplification30.8%

    \[\leadsto x \cdot 2 \]

Developer target: 95.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\ \;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (< y 7.590524218811189e-161)
   (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b)))
   (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y < 7.590524218811189e-161) {
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y < 7.590524218811189d-161) then
        tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
    else
        tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y < 7.590524218811189e-161) {
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y < 7.590524218811189e-161:
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b))
	else:
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y < 7.590524218811189e-161)
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b)));
	else
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y < 7.590524218811189e-161)
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	else
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023297 
(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)))