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

Percentage Accurate: 95.6% → 98.6%
Time: 18.8s
Alternatives: 15
Speedup: 0.8×

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 15 alternatives:

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

Initial Program: 95.6% accurate, 1.0× speedup?

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

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

Alternative 1: 98.6% accurate, 0.1× speedup?

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

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


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

    1. Initial program 96.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. +-commutative96.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot t\right) \cdot z\right) \]
      11. fma-def95.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-inv95.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-def95.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-in95.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-in95.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. *-commutative95.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.9%

        \[\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. associate-*l*96.8%

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

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

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

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

    if 4.99999999999999964e224 < (*.f64 (*.f64 y 9) z)

    1. Initial program 77.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-neg77.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-neg77.3%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*96.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*96.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. Simplified96.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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg96.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 48.9% accurate, 0.4× speedup?

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

\mathbf{elif}\;t \leq 1.05 \cdot 10^{-169}:\\
\;\;\;\;x \cdot 2\\

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

\mathbf{elif}\;t \leq 2.4 \cdot 10^{-45}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;t \leq 1.32 \cdot 10^{+39}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 6 \cdot 10^{+64}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;t \leq 8.8 \cdot 10^{+127}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.9500000000000001e-150 or 8.8000000000000007e127 < t

    1. Initial program 96.1%

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

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

        \[\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.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. Simplified91.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. Add Preprocessing
    5. Taylor expanded in y around inf 49.2%

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

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

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

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

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

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

    if -1.9500000000000001e-150 < t < 1.05e-169 or 7.5e-97 < t < 2.3999999999999999e-45 or 1.32e39 < t < 6.0000000000000004e64

    1. Initial program 92.1%

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*99.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. Simplified99.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. Add Preprocessing
    5. Taylor expanded in x around inf 47.9%

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

    if 1.05e-169 < t < 7.5e-97

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.3999999999999999e-45 < t < 1.32e39 or 6.0000000000000004e64 < t < 8.8000000000000007e127

    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*85.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*85.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. Simplified85.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. Add Preprocessing
    5. Taylor expanded in a around inf 42.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.95 \cdot 10^{-150}:\\ \;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-169}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-97}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-45}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 1.32 \cdot 10^{+39}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+64}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 8.8 \cdot 10^{+127}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 48.9% accurate, 0.4× speedup?

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

\mathbf{elif}\;t \leq 1.05 \cdot 10^{-169}:\\
\;\;\;\;x \cdot 2\\

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

\mathbf{elif}\;t \leq 1.18 \cdot 10^{-45}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;t \leq 2.2 \cdot 10^{+40}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.52 \cdot 10^{+63}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;t \leq 8.8 \cdot 10^{+127}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.9500000000000001e-150 or 8.8000000000000007e127 < t

    1. Initial program 96.1%

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

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

        \[\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.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. Simplified91.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. Add Preprocessing
    5. Taylor expanded in y around inf 49.2%

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

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

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

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

    if -1.9500000000000001e-150 < t < 1.05e-169 or 1.05e-95 < t < 1.18e-45 or 2.1999999999999999e40 < t < 1.51999999999999993e63

    1. Initial program 92.1%

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*99.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. Simplified99.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. Add Preprocessing
    5. Taylor expanded in x around inf 48.4%

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

    if 1.05e-169 < t < 1.05e-95

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.18e-45 < t < 2.1999999999999999e40 or 1.51999999999999993e63 < t < 8.8000000000000007e127

    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*86.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.95 \cdot 10^{-150}:\\ \;\;\;\;\left(t \cdot -9\right) \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-169}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-95}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;t \leq 1.18 \cdot 10^{-45}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{+40}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;t \leq 1.52 \cdot 10^{+63}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 8.8 \cdot 10^{+127}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot -9\right) \cdot \left(y \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 45.4% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.8e52 or -8.10000000000000022e-112 < a < -2.20000000000000022e-174 or 8.8000000000000006e39 < a

    1. Initial program 94.4%

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

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

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*91.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*91.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. Simplified91.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. Add Preprocessing
    5. Taylor expanded in a around inf 56.4%

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

    if -6.8e52 < a < -8.10000000000000022e-112 or -2.20000000000000022e-174 < a < 8.8000000000000006e39

    1. Initial program 94.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-neg94.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-neg94.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*97.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*97.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.8 \cdot 10^{+52} \lor \neg \left(a \leq -8.1 \cdot 10^{-112} \lor \neg \left(a \leq -2.2 \cdot 10^{-174}\right) \land a \leq 8.8 \cdot 10^{+39}\right):\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 45.4% accurate, 0.7× speedup?

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

\mathbf{elif}\;a \leq -2.55 \cdot 10^{-111} \lor \neg \left(a \leq -2.2 \cdot 10^{-174}\right) \land a \leq 4 \cdot 10^{+39}:\\
\;\;\;\;x \cdot 2\\

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


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

    1. Initial program 93.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-neg93.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-neg93.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*86.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*87.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. Simplified87.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. Add Preprocessing
    5. Taylor expanded in a around inf 61.8%

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

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

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

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

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

    if -1.4e52 < a < -2.55000000000000016e-111 or -2.20000000000000022e-174 < a < 3.99999999999999976e39

    1. Initial program 94.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-neg94.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-neg94.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*97.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*97.7%

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

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

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

    if -2.55000000000000016e-111 < a < -2.20000000000000022e-174 or 3.99999999999999976e39 < a

    1. Initial program 95.0%

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

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg95.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*93.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*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. Add Preprocessing
    5. Taylor expanded in a around inf 53.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.4 \cdot 10^{+52}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;a \leq -2.55 \cdot 10^{-111} \lor \neg \left(a \leq -2.2 \cdot 10^{-174}\right) \land a \leq 4 \cdot 10^{+39}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 45.4% accurate, 0.7× speedup?

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

\mathbf{elif}\;a \leq -6.5 \cdot 10^{-112} \lor \neg \left(a \leq -2.2 \cdot 10^{-174}\right) \land a \leq 1.9 \cdot 10^{+40}:\\
\;\;\;\;x \cdot 2\\

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


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

    1. Initial program 93.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-neg93.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-neg93.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*86.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*87.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. Simplified87.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. Add Preprocessing
    5. Taylor expanded in a around inf 61.8%

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

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

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

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

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

    if -2.94999999999999991e51 < a < -6.49999999999999956e-112 or -2.20000000000000022e-174 < a < 1.90000000000000002e40

    1. Initial program 94.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-neg94.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-neg94.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*97.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*97.7%

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

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

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

    if -6.49999999999999956e-112 < a < -2.20000000000000022e-174 or 1.90000000000000002e40 < a

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.95 \cdot 10^{+51}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;a \leq -6.5 \cdot 10^{-112} \lor \neg \left(a \leq -2.2 \cdot 10^{-174}\right) \land a \leq 1.9 \cdot 10^{+40}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 80.6% accurate, 0.7× speedup?

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

\mathbf{elif}\;z \leq 8 \cdot 10^{-6}:\\
\;\;\;\;x \cdot 2 + t_1\\

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


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

    1. Initial program 88.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. Add Preprocessing
    3. Taylor expanded in y around 0 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.31999999999999997e-87 < z < 7.99999999999999964e-6

    1. Initial program 99.8%

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

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

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

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

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

    if 7.99999999999999964e-6 < z

    1. Initial program 95.0%

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

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

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

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

Alternative 8: 80.6% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 88.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. Add Preprocessing
    3. Taylor expanded in y around 0 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.31999999999999997e-87 < z < 2.3e-6

    1. Initial program 99.8%

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

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

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

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

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

    if 2.3e-6 < z

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 97.0% accurate, 0.8× speedup?

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

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


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

    1. Initial program 94.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-neg94.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-neg94.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*97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6e62 < z

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 98.2% accurate, 0.8× speedup?

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

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


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

    1. Initial program 90.8%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg90.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-neg90.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*94.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*94.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. Simplified94.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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg94.8%

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e-209 < z

    1. Initial program 97.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. Add Preprocessing
    3. Taylor expanded in y around 0 97.8%

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

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

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

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

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

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

Alternative 11: 79.4% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 84.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-neg84.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-neg84.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*91.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*91.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. Simplified91.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. Add Preprocessing
    5. Taylor expanded in a around 0 64.8%

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

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

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

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

        \[\leadsto \left(-\color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot 9}\right) + x \cdot 2 \]
      5. distribute-rgt-neg-in64.8%

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

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

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

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

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

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

    if -2.50000000000000023e24 < z < 1.7499999999999999e-44

    1. Initial program 99.8%

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

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

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

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

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

    if 1.7499999999999999e-44 < z

    1. Initial program 95.8%

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

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

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

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

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

Alternative 12: 80.6% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 88.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. Add Preprocessing
    3. Taylor expanded in y around 0 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.1999999999999999e-88 < z < 1.9e-44

    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.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. Simplified99.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. Add Preprocessing
    5. Taylor expanded in y around 0 86.3%

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

    if 1.9e-44 < z

    1. Initial program 95.8%

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

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

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

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

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

Alternative 13: 75.2% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.5e30 < z < 1.00000000000000006e63

    1. Initial program 99.8%

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

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

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

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

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

    if 1.00000000000000006e63 < z

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\color{blue}{y \cdot \left(z \cdot \left(t \cdot -9\right)\right)}}\right)}^{2} \]
    9. Applied egg-rr25.5%

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

        \[\leadsto \color{blue}{\sqrt{y \cdot \left(z \cdot \left(t \cdot -9\right)\right)} \cdot \sqrt{y \cdot \left(z \cdot \left(t \cdot -9\right)\right)}} \]
      2. add-sqr-sqrt42.7%

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

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

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

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

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

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

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

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

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

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

Alternative 14: 76.6% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 84.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-neg84.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-neg84.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*91.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*91.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. Simplified91.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. Add Preprocessing
    5. Taylor expanded in a around 0 64.8%

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

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

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

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

        \[\leadsto \left(-\color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot 9}\right) + x \cdot 2 \]
      5. distribute-rgt-neg-in64.8%

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

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

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

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

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

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

    if -5.8000000000000002e27 < z < 1.6999999999999999e63

    1. Initial program 99.8%

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

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

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

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

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

    if 1.6999999999999999e63 < z

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\color{blue}{y \cdot \left(z \cdot \left(t \cdot -9\right)\right)}}\right)}^{2} \]
    9. Applied egg-rr25.5%

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

        \[\leadsto \color{blue}{\sqrt{y \cdot \left(z \cdot \left(t \cdot -9\right)\right)} \cdot \sqrt{y \cdot \left(z \cdot \left(t \cdot -9\right)\right)}} \]
      2. add-sqr-sqrt42.7%

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

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

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

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

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

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

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

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

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

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

Alternative 15: 31.4% accurate, 5.7× speedup?

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

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

      \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
    2. sub-neg94.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*94.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*94.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. Simplified94.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. Add Preprocessing
  5. Taylor expanded in x around inf 30.8%

    \[\leadsto \color{blue}{2 \cdot x} \]
  6. Final simplification30.8%

    \[\leadsto x \cdot 2 \]
  7. Add Preprocessing

Developer target: 95.1% accurate, 0.8× 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 2024011 
(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)))