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

Percentage Accurate: 95.6% → 98.1%
Time: 18.1s
Alternatives: 14
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 14 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.6% 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.1% accurate, 0.1× speedup?

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

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


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

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.9999999999999996e-256 < z

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 78.4% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x 2) < -2.0000000000000001e108

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e108 < (*.f64 x 2) < 1.99999999999999987e-49

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999987e-49 < (*.f64 x 2)

    1. Initial program 91.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. associate-+l-91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 78.5% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x 2) < -2.0000000000000001e108

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e108 < (*.f64 x 2) < 1.99999999999999987e-49

    1. Initial program 97.6%

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

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

    if 1.99999999999999987e-49 < (*.f64 x 2)

    1. Initial program 91.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. associate-+l-91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 47.1% accurate, 0.9× speedup?

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

\mathbf{elif}\;x \leq -0.00096:\\
\;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\

\mathbf{elif}\;x \leq -2.2 \cdot 10^{-187}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq -7.5 \cdot 10^{-255}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 3.1 \cdot 10^{-290}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 1.56 \cdot 10^{-117}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -7.59999999999999989e123 or 1.4500000000000001e74 < x

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.59999999999999989e123 < x < -9.60000000000000024e-4

    1. Initial program 99.7%

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

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

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

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

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

    if -9.60000000000000024e-4 < x < -2.20000000000000008e-187 or -7.50000000000000029e-255 < x < 3.0999999999999999e-290

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.20000000000000008e-187 < x < -7.50000000000000029e-255 or 3.0999999999999999e-290 < x < 1.56e-117

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.56e-117 < x < 1.4500000000000001e74

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.6 \cdot 10^{+123}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -0.00096:\\ \;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\ \mathbf{elif}\;x \leq -2.2 \cdot 10^{-187}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{-255}:\\ \;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{-290}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq 1.56 \cdot 10^{-117}:\\ \;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{+74}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 5: 96.2% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.84999999999999999e68

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

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

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

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

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

    if 1.84999999999999999e68 < z

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 98.2% accurate, 0.9× speedup?

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

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


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

    1. Initial program 96.8%

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

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

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

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

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

    if 5e-256 < z

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

Alternative 7: 98.1% accurate, 0.9× speedup?

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

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


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

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5e-256 < z

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

Alternative 8: 46.0% accurate, 1.0× speedup?

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

\mathbf{elif}\;a \leq -3 \cdot 10^{+222}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -3.2 \cdot 10^{-5}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq -8.2 \cdot 10^{-84}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;a \leq -8 \cdot 10^{-288}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 2.9 \cdot 10^{-89}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.9499999999999999e239 or -3.00000000000000014e222 < a < -3.19999999999999986e-5

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9499999999999999e239 < a < -3.00000000000000014e222 or -8.2000000000000001e-84 < a < -8.00000000000000046e-288

    1. Initial program 91.2%

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

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

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

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

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

    if -3.19999999999999986e-5 < a < -8.2000000000000001e-84 or -8.00000000000000046e-288 < a < 2.89999999999999992e-89

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.89999999999999992e-89 < a

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.95 \cdot 10^{+239}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq -3 \cdot 10^{+222}:\\ \;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\ \mathbf{elif}\;a \leq -3.2 \cdot 10^{-5}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq -8.2 \cdot 10^{-84}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;a \leq -8 \cdot 10^{-288}:\\ \;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{-89}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \]

Alternative 9: 76.4% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.80000000000000012e-176 or 2.09999999999999983e119 < t

    1. Initial program 95.9%

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

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

    if -4.80000000000000012e-176 < t < 2.09999999999999983e119

    1. Initial program 92.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. associate-+l-92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 75.9% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 89.6%

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

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

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

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

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

    if -7.4999999999999999e82 < z < 2.3e66

    1. Initial program 99.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. associate-+l-99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.3e66 < z

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 76.1% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 89.9%

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

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

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

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

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

    if -9.99999999999999967e78 < z < 2.1e64

    1. Initial program 99.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. associate-+l-99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.1e64 < z

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 47.4% accurate, 1.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.7e-5 or 6.50000000000000034e-89 < a

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7e-5 < a < 6.50000000000000034e-89

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.7 \cdot 10^{-5} \lor \neg \left(a \leq 6.5 \cdot 10^{-89}\right):\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 13: 47.3% accurate, 1.9× speedup?

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

\mathbf{elif}\;a \leq 3.7 \cdot 10^{-93}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.6999999999999999e-5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.6999999999999999e-5 < a < 3.70000000000000002e-93

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.70000000000000002e-93 < a

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.7 \cdot 10^{-5}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{-93}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \]

Alternative 14: 31.8% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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