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

Percentage Accurate: 95.2% → 98.6%
Time: 14.8s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 98.6% accurate, 0.1× speedup?

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

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


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

    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 97.2%

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

    if 1.00000000000000002e100 < (*.f64 (*.f64 y 9) z)

    1. Initial program 83.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. +-commutative83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.1% accurate, 0.7× speedup?

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

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


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

    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 97.2%

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

    if 1.00000000000000002e100 < (*.f64 (*.f64 y 9) z)

    1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 70.7% accurate, 0.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{+100}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 3.9 \cdot 10^{+104} \lor \neg \left(b \leq 7.5 \cdot 10^{+125}\right) \land b \leq 1.15 \cdot 10^{+169}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(\left(y \cdot z\right) \cdot t\right)\\ \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 (<= b -1.35e+100)
   (* 27.0 (* a b))
   (if (or (<= b 3.9e+104) (and (not (<= b 7.5e+125)) (<= b 1.15e+169)))
     (- (* x 2.0) (* 9.0 (* (* y z) t)))
     (* a (* 27.0 b)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.35e+100) {
		tmp = 27.0 * (a * b);
	} else if ((b <= 3.9e+104) || (!(b <= 7.5e+125) && (b <= 1.15e+169))) {
		tmp = (x * 2.0) - (9.0 * ((y * z) * t));
	} 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 (b <= (-1.35d+100)) then
        tmp = 27.0d0 * (a * b)
    else if ((b <= 3.9d+104) .or. (.not. (b <= 7.5d+125)) .and. (b <= 1.15d+169)) then
        tmp = (x * 2.0d0) - (9.0d0 * ((y * z) * t))
    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 (b <= -1.35e+100) {
		tmp = 27.0 * (a * b);
	} else if ((b <= 3.9e+104) || (!(b <= 7.5e+125) && (b <= 1.15e+169))) {
		tmp = (x * 2.0) - (9.0 * ((y * z) * t));
	} 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 b <= -1.35e+100:
		tmp = 27.0 * (a * b)
	elif (b <= 3.9e+104) or (not (b <= 7.5e+125) and (b <= 1.15e+169)):
		tmp = (x * 2.0) - (9.0 * ((y * z) * t))
	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 (b <= -1.35e+100)
		tmp = Float64(27.0 * Float64(a * b));
	elseif ((b <= 3.9e+104) || (!(b <= 7.5e+125) && (b <= 1.15e+169)))
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(Float64(y * z) * t)));
	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 (b <= -1.35e+100)
		tmp = 27.0 * (a * b);
	elseif ((b <= 3.9e+104) || (~((b <= 7.5e+125)) && (b <= 1.15e+169)))
		tmp = (x * 2.0) - (9.0 * ((y * z) * t));
	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[b, -1.35e+100], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, 3.9e+104], And[N[Not[LessEqual[b, 7.5e+125]], $MachinePrecision], LessEqual[b, 1.15e+169]]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $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}\;b \leq -1.35 \cdot 10^{+100}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;b \leq 3.9 \cdot 10^{+104} \lor \neg \left(b \leq 7.5 \cdot 10^{+125}\right) \land b \leq 1.15 \cdot 10^{+169}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(\left(y \cdot z\right) \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.34999999999999999e100

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.34999999999999999e100 < b < 3.90000000000000017e104 or 7.5000000000000006e125 < b < 1.15e169

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.90000000000000017e104 < b < 7.5000000000000006e125 or 1.15e169 < b

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u37.3%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(27 \cdot \left(a \cdot b\right)\right)} - 1} \]
    6. Applied egg-rr37.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{+100}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 3.9 \cdot 10^{+104} \lor \neg \left(b \leq 7.5 \cdot 10^{+125}\right) \land b \leq 1.15 \cdot 10^{+169}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(\left(y \cdot z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \]

Alternative 4: 95.2% accurate, 1.0× speedup?

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

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

Alternative 5: 47.4% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;t \leq 3.4 \cdot 10^{+14}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;t \leq 7 \cdot 10^{+83}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -3.5999999999999999e-180 or 6.99999999999999954e83 < t

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5999999999999999e-180 < t < 1.81999999999999994e-208

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u31.3%

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

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

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

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

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

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

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

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

    if 1.81999999999999994e-208 < t < 3.4e14

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.4e14 < t < 6.99999999999999954e83

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{-180}:\\ \;\;\;\;-9 \cdot \left(\left(y \cdot z\right) \cdot t\right)\\ \mathbf{elif}\;t \leq 1.82 \cdot 10^{-208}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{+14}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 7 \cdot 10^{+83}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(\left(y \cdot z\right) \cdot t\right)\\ \end{array} \]

Alternative 6: 47.4% accurate, 1.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{-180}:\\ \;\;\;\;-9 \cdot \left(\left(y \cdot z\right) \cdot t\right)\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{-207}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;t \leq 25000000000000:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+83}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\left(y \cdot z\right) \cdot -9\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -3.6e-180)
   (* -9.0 (* (* y z) t))
   (if (<= t 2.25e-207)
     (* a (* 27.0 b))
     (if (<= t 25000000000000.0)
       (* x 2.0)
       (if (<= t 6e+83) (* 27.0 (* a b)) (* 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 (t <= -3.6e-180) {
		tmp = -9.0 * ((y * z) * t);
	} else if (t <= 2.25e-207) {
		tmp = a * (27.0 * b);
	} else if (t <= 25000000000000.0) {
		tmp = x * 2.0;
	} else if (t <= 6e+83) {
		tmp = 27.0 * (a * b);
	} else {
		tmp = 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 (t <= (-3.6d-180)) then
        tmp = (-9.0d0) * ((y * z) * t)
    else if (t <= 2.25d-207) then
        tmp = a * (27.0d0 * b)
    else if (t <= 25000000000000.0d0) then
        tmp = x * 2.0d0
    else if (t <= 6d+83) then
        tmp = 27.0d0 * (a * b)
    else
        tmp = 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 (t <= -3.6e-180) {
		tmp = -9.0 * ((y * z) * t);
	} else if (t <= 2.25e-207) {
		tmp = a * (27.0 * b);
	} else if (t <= 25000000000000.0) {
		tmp = x * 2.0;
	} else if (t <= 6e+83) {
		tmp = 27.0 * (a * b);
	} else {
		tmp = 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 t <= -3.6e-180:
		tmp = -9.0 * ((y * z) * t)
	elif t <= 2.25e-207:
		tmp = a * (27.0 * b)
	elif t <= 25000000000000.0:
		tmp = x * 2.0
	elif t <= 6e+83:
		tmp = 27.0 * (a * b)
	else:
		tmp = 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 (t <= -3.6e-180)
		tmp = Float64(-9.0 * Float64(Float64(y * z) * t));
	elseif (t <= 2.25e-207)
		tmp = Float64(a * Float64(27.0 * b));
	elseif (t <= 25000000000000.0)
		tmp = Float64(x * 2.0);
	elseif (t <= 6e+83)
		tmp = Float64(27.0 * Float64(a * b));
	else
		tmp = Float64(t * Float64(Float64(y * 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 (t <= -3.6e-180)
		tmp = -9.0 * ((y * z) * t);
	elseif (t <= 2.25e-207)
		tmp = a * (27.0 * b);
	elseif (t <= 25000000000000.0)
		tmp = x * 2.0;
	elseif (t <= 6e+83)
		tmp = 27.0 * (a * b);
	else
		tmp = 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[t, -3.6e-180], N[(-9.0 * N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.25e-207], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 25000000000000.0], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 6e+83], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y * z), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{-180}:\\
\;\;\;\;-9 \cdot \left(\left(y \cdot z\right) \cdot t\right)\\

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

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

\mathbf{elif}\;t \leq 6 \cdot 10^{+83}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -3.5999999999999999e-180

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5999999999999999e-180 < t < 2.24999999999999996e-207

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u31.3%

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

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

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

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

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

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

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

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

    if 2.24999999999999996e-207 < t < 2.5e13

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5e13 < t < 5.9999999999999999e83

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.9999999999999999e83 < t

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 47.9% accurate, 1.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{-180}:\\ \;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-207}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;t \leq 30500000000000:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{+84}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\left(y \cdot z\right) \cdot -9\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -3.6e-180)
   (* y (* -9.0 (* z t)))
   (if (<= t 1.2e-207)
     (* a (* 27.0 b))
     (if (<= t 30500000000000.0)
       (* x 2.0)
       (if (<= t 1.25e+84) (* 27.0 (* a b)) (* 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 (t <= -3.6e-180) {
		tmp = y * (-9.0 * (z * t));
	} else if (t <= 1.2e-207) {
		tmp = a * (27.0 * b);
	} else if (t <= 30500000000000.0) {
		tmp = x * 2.0;
	} else if (t <= 1.25e+84) {
		tmp = 27.0 * (a * b);
	} else {
		tmp = 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 (t <= (-3.6d-180)) then
        tmp = y * ((-9.0d0) * (z * t))
    else if (t <= 1.2d-207) then
        tmp = a * (27.0d0 * b)
    else if (t <= 30500000000000.0d0) then
        tmp = x * 2.0d0
    else if (t <= 1.25d+84) then
        tmp = 27.0d0 * (a * b)
    else
        tmp = 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 (t <= -3.6e-180) {
		tmp = y * (-9.0 * (z * t));
	} else if (t <= 1.2e-207) {
		tmp = a * (27.0 * b);
	} else if (t <= 30500000000000.0) {
		tmp = x * 2.0;
	} else if (t <= 1.25e+84) {
		tmp = 27.0 * (a * b);
	} else {
		tmp = 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 t <= -3.6e-180:
		tmp = y * (-9.0 * (z * t))
	elif t <= 1.2e-207:
		tmp = a * (27.0 * b)
	elif t <= 30500000000000.0:
		tmp = x * 2.0
	elif t <= 1.25e+84:
		tmp = 27.0 * (a * b)
	else:
		tmp = 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 (t <= -3.6e-180)
		tmp = Float64(y * Float64(-9.0 * Float64(z * t)));
	elseif (t <= 1.2e-207)
		tmp = Float64(a * Float64(27.0 * b));
	elseif (t <= 30500000000000.0)
		tmp = Float64(x * 2.0);
	elseif (t <= 1.25e+84)
		tmp = Float64(27.0 * Float64(a * b));
	else
		tmp = Float64(t * Float64(Float64(y * 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 (t <= -3.6e-180)
		tmp = y * (-9.0 * (z * t));
	elseif (t <= 1.2e-207)
		tmp = a * (27.0 * b);
	elseif (t <= 30500000000000.0)
		tmp = x * 2.0;
	elseif (t <= 1.25e+84)
		tmp = 27.0 * (a * b);
	else
		tmp = 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[t, -3.6e-180], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-207], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 30500000000000.0], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 1.25e+84], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y * z), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{-180}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\

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

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

\mathbf{elif}\;t \leq 1.25 \cdot 10^{+84}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -3.5999999999999999e-180

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5999999999999999e-180 < t < 1.19999999999999994e-207

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u31.3%

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

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

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

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

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

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

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

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

    if 1.19999999999999994e-207 < t < 3.05e13

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.05e13 < t < 1.25e84

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.25e84 < t

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{-180}:\\ \;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-207}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;t \leq 30500000000000:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{+84}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\left(y \cdot z\right) \cdot -9\right)\\ \end{array} \]

Alternative 8: 46.9% accurate, 1.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{+69} \lor \neg \left(a \leq 6400000000\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 -5.2e+69) (not (<= a 6400000000.0)))
   (* 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 <= -5.2e+69) || !(a <= 6400000000.0)) {
		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 <= (-5.2d+69)) .or. (.not. (a <= 6400000000.0d0))) 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 <= -5.2e+69) || !(a <= 6400000000.0)) {
		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 <= -5.2e+69) or not (a <= 6400000000.0):
		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 <= -5.2e+69) || !(a <= 6400000000.0))
		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 <= -5.2e+69) || ~((a <= 6400000000.0)))
		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, -5.2e+69], N[Not[LessEqual[a, 6400000000.0]], $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 -5.2 \cdot 10^{+69} \lor \neg \left(a \leq 6400000000\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 < -5.2000000000000004e69 or 6.4e9 < a

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2000000000000004e69 < a < 6.4e9

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 46.9% accurate, 1.9× speedup?

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

\mathbf{elif}\;a \leq 6600000000:\\
\;\;\;\;x \cdot 2\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(27 \cdot \left(a \cdot b\right)\right)\right)} \]
      2. expm1-udef27.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(27 \cdot \left(a \cdot b\right)\right)} - 1} \]
    6. Applied egg-rr27.2%

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

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

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

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

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

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

    if -9.1999999999999994e67 < a < 6.6e9

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.6e9 < a

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 30.7% 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.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x \cdot 2 \]

Developer target: 94.6% 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 2023287 
(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)))