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

Percentage Accurate: 95.5% → 98.4%
Time: 11.0s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 95.5% accurate, 1.0× speedup?

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

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

Alternative 1: 98.4% accurate, 0.1× speedup?

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

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


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

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999999e98 < t

    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. +-commutative93.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-93.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. *-commutative93.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)} \]
      4. cancel-sign-sub-inv93.4%

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

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

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

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

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

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

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

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

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

        \[\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. distribute-lft-neg-in87.6%

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

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

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

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

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

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

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

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

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

Alternative 2: 96.6% accurate, 0.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \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) \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
 (fma a (* 27.0 b) (fma x 2.0 (* y (* t (* -9.0 z))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	return fma(a, (27.0 * b), fma(x, 2.0, (y * (t * (-9.0 * z)))));
}
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	return fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(t * Float64(-9.0 * z)))))
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(t * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\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)
\end{array}
Derivation
  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. Simplified95.0%

    \[\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. Final simplification95.0%

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

Alternative 3: 81.5% accurate, 0.7× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ t_2 := b \cdot \left(a \cdot 27\right)\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{+150} \lor \neg \left(t_2 \leq 4 \cdot 10^{+170}\right):\\ \;\;\;\;27 \cdot \left(a \cdot b\right) - t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 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 (* t (* y z)))) (t_2 (* b (* a 27.0))))
   (if (or (<= t_2 -5e+150) (not (<= t_2 4e+170)))
     (- (* 27.0 (* a b)) t_1)
     (- (* x 2.0) t_1))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = 9.0 * (t * (y * z));
	double t_2 = b * (a * 27.0);
	double tmp;
	if ((t_2 <= -5e+150) || !(t_2 <= 4e+170)) {
		tmp = (27.0 * (a * b)) - t_1;
	} else {
		tmp = (x * 2.0) - 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) :: t_2
    real(8) :: tmp
    t_1 = 9.0d0 * (t * (y * z))
    t_2 = b * (a * 27.0d0)
    if ((t_2 <= (-5d+150)) .or. (.not. (t_2 <= 4d+170))) then
        tmp = (27.0d0 * (a * b)) - t_1
    else
        tmp = (x * 2.0d0) - 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 * (t * (y * z));
	double t_2 = b * (a * 27.0);
	double tmp;
	if ((t_2 <= -5e+150) || !(t_2 <= 4e+170)) {
		tmp = (27.0 * (a * b)) - t_1;
	} else {
		tmp = (x * 2.0) - t_1;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	t_1 = 9.0 * (t * (y * z))
	t_2 = b * (a * 27.0)
	tmp = 0
	if (t_2 <= -5e+150) or not (t_2 <= 4e+170):
		tmp = (27.0 * (a * b)) - t_1
	else:
		tmp = (x * 2.0) - 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(t * Float64(y * z)))
	t_2 = Float64(b * Float64(a * 27.0))
	tmp = 0.0
	if ((t_2 <= -5e+150) || !(t_2 <= 4e+170))
		tmp = Float64(Float64(27.0 * Float64(a * b)) - t_1);
	else
		tmp = Float64(Float64(x * 2.0) - 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 * (t * (y * z));
	t_2 = b * (a * 27.0);
	tmp = 0.0;
	if ((t_2 <= -5e+150) || ~((t_2 <= 4e+170)))
		tmp = (27.0 * (a * b)) - t_1;
	else
		tmp = (x * 2.0) - 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[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -5e+150], N[Not[LessEqual[t$95$2, 4e+170]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_2 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+150} \lor \neg \left(t_2 \leq 4 \cdot 10^{+170}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 a 27) b) < -5.00000000000000009e150 or 4.00000000000000014e170 < (*.f64 (*.f64 a 27) b)

    1. Initial program 91.5%

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

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

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

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

    if -5.00000000000000009e150 < (*.f64 (*.f64 a 27) b) < 4.00000000000000014e170

    1. Initial program 97.2%

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

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

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

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

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

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

Alternative 4: 81.5% accurate, 0.7× speedup?

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

\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+170}:\\
\;\;\;\;x \cdot 2 - t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 a 27) b) < -5.00000000000000009e150

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000009e150 < (*.f64 (*.f64 a 27) b) < 4.00000000000000014e170

    1. Initial program 97.2%

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

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

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

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

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

    if 4.00000000000000014e170 < (*.f64 (*.f64 a 27) b)

    1. Initial program 83.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-neg83.0%

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

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

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

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

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

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

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

Alternative 5: 79.4% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 a 27) b) < -5.00000000000000009e150

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -5.00000000000000009e150 < (*.f64 (*.f64 a 27) b) < 2.00000000000000008e201

    1. Initial program 96.3%

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

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

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

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

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

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

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

    if 2.00000000000000008e201 < (*.f64 (*.f64 a 27) b)

    1. Initial program 86.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-neg86.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. sub-neg86.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 50.5% accurate, 1.0× speedup?

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

\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+170}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 a 27) b) < -5.00000000000000009e150

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -5.00000000000000009e150 < (*.f64 (*.f64 a 27) b) < 4.00000000000000014e170

    1. Initial program 97.2%

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

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

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

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

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

    if 4.00000000000000014e170 < (*.f64 (*.f64 a 27) b)

    1. Initial program 83.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-neg83.0%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{a \cdot \left(27 \cdot b\right)}\right)}^{2}} \]
    9. Step-by-step derivation
      1. unpow277.6%

        \[\leadsto \color{blue}{\sqrt{a \cdot \left(27 \cdot b\right)} \cdot \sqrt{a \cdot \left(27 \cdot b\right)}} \]
      2. add-sqr-sqrt77.7%

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

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

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

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

Alternative 7: 95.8% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 8: 95.8% accurate, 1.0× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \left(a \cdot \left(27 \cdot b\right) + x \cdot 2\right) - y \cdot \left(9 \cdot \left(t \cdot z\right)\right) \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (- (+ (* a (* 27.0 b)) (* x 2.0)) (* y (* 9.0 (* t z)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	return ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (t * z)));
}
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 = ((a * (27.0d0 * b)) + (x * 2.0d0)) - (y * (9.0d0 * (t * z)))
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (t * z)));
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	return ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (t * z)))
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(a * Float64(27.0 * b)) + Float64(x * 2.0)) - Float64(y * Float64(9.0 * Float64(t * z))))
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp = code(x, y, z, t, a, b)
	tmp = ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (t * z)));
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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\left(a \cdot \left(27 \cdot b\right) + x \cdot 2\right) - y \cdot \left(9 \cdot \left(t \cdot z\right)\right)
\end{array}
Derivation
  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. sub-neg95.7%

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

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

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

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

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

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

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

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

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

Alternative 9: 48.0% accurate, 1.3× speedup?

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

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-236}:\\
\;\;\;\;x \cdot 2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.8e12 or 4.00000000000000027e-68 < z

    1. Initial program 93.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-neg93.0%

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

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

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

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

    if -4.8e12 < z < 2.09999999999999979e-236

    1. Initial program 98.8%

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

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

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

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

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

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

    if 2.09999999999999979e-236 < z < 4.00000000000000027e-68

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{a \cdot \left(27 \cdot b\right)} \cdot \sqrt{a \cdot \left(27 \cdot b\right)}} \]
      2. add-sqr-sqrt43.5%

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

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

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

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

Alternative 10: 49.7% accurate, 1.3× speedup?

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

\mathbf{elif}\;z \leq 5.8 \cdot 10^{-237}:\\
\;\;\;\;x \cdot 2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.2e6

    1. Initial program 91.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-neg91.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.2e6 < z < 5.80000000000000022e-237

    1. Initial program 98.8%

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

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

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

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

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

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

    if 5.80000000000000022e-237 < z < 6.4999999999999998e-63

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{a \cdot \left(27 \cdot b\right)} \cdot \sqrt{a \cdot \left(27 \cdot b\right)}} \]
      2. add-sqr-sqrt43.5%

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

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

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

    if 6.4999999999999998e-63 < z

    1. Initial program 94.2%

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

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

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

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

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

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

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

Alternative 11: 49.6% accurate, 1.3× speedup?

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

\mathbf{elif}\;z \leq 1.75 \cdot 10^{-248}:\\
\;\;\;\;x \cdot 2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.5e8

    1. Initial program 91.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-neg91.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5e8 < z < 1.74999999999999991e-248

    1. Initial program 98.8%

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

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

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

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

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

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

    if 1.74999999999999991e-248 < z < 3.50000000000000005e-65

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{a \cdot \left(27 \cdot b\right)}\right)}^{2}} \]
    9. Step-by-step derivation
      1. unpow233.6%

        \[\leadsto \color{blue}{\sqrt{a \cdot \left(27 \cdot b\right)} \cdot \sqrt{a \cdot \left(27 \cdot b\right)}} \]
      2. add-sqr-sqrt45.6%

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

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

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

    if 3.50000000000000005e-65 < z

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 49.7% accurate, 1.3× speedup?

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

\mathbf{elif}\;z \leq 3.4 \cdot 10^{-241}:\\
\;\;\;\;x \cdot 2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.8e7

    1. Initial program 91.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-neg91.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8e7 < z < 3.3999999999999999e-241

    1. Initial program 98.8%

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

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

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

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

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

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

    if 3.3999999999999999e-241 < z < 1.70000000000000009e-68

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{a \cdot \left(27 \cdot b\right)}\right)}^{2}} \]
    9. Step-by-step derivation
      1. unpow233.6%

        \[\leadsto \color{blue}{\sqrt{a \cdot \left(27 \cdot b\right)} \cdot \sqrt{a \cdot \left(27 \cdot b\right)}} \]
      2. add-sqr-sqrt45.6%

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

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

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

    if 1.70000000000000009e-68 < z

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 75.2% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 89.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-neg89.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. sub-neg89.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7500000000000001e60 < z < 2.75000000000000008e104

    1. Initial program 99.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-neg99.3%

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

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

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

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

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

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

    if 2.75000000000000008e104 < z

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 47.2% accurate, 1.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{-23} \lor \neg \left(x \leq 2.1 \cdot 10^{+43}\right):\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= x -4.8e-23) (not (<= x 2.1e+43))) (* 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 ((x <= -4.8e-23) || !(x <= 2.1e+43)) {
		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 ((x <= (-4.8d-23)) .or. (.not. (x <= 2.1d+43))) 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 ((x <= -4.8e-23) || !(x <= 2.1e+43)) {
		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 (x <= -4.8e-23) or not (x <= 2.1e+43):
		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 ((x <= -4.8e-23) || !(x <= 2.1e+43))
		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 ((x <= -4.8e-23) || ~((x <= 2.1e+43)))
		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[Or[LessEqual[x, -4.8e-23], N[Not[LessEqual[x, 2.1e+43]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{-23} \lor \neg \left(x \leq 2.1 \cdot 10^{+43}\right):\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.79999999999999993e-23 or 2.10000000000000002e43 < x

    1. Initial program 93.8%

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

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

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

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

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

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

    if -4.79999999999999993e-23 < x < 2.10000000000000002e43

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

Alternative 15: 47.1% accurate, 1.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.0000000000000003e-29 or 1.08e42 < x

    1. Initial program 93.8%

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

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

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

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

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

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

    if -3.0000000000000003e-29 < x < 1.08e42

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 31.1% accurate, 5.7× speedup?

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

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

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

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

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

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

    \[\leadsto x \cdot 2 \]

Developer target: 95.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\ \;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (< y 7.590524218811189e-161)
   (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b)))
   (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y < 7.590524218811189e-161) {
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y < 7.590524218811189d-161) then
        tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
    else
        tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y < 7.590524218811189e-161) {
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y < 7.590524218811189e-161:
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b))
	else:
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y < 7.590524218811189e-161)
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b)));
	else
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y < 7.590524218811189e-161)
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	else
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023336 
(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)))