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

Percentage Accurate: 95.3% → 96.0%
Time: 25.7s
Alternatives: 8
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 8 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.3% 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: 96.0% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) + y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\right) \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) (+ (* a (* 27.0 b)) (* y (* t (* z -9.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) + ((a * (27.0 * b)) + (y * (t * (z * -9.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) + ((a * (27.0d0 * b)) + (y * (t * (z * (-9.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) + ((a * (27.0 * b)) + (y * (t * (z * -9.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) + ((a * (27.0 * b)) + (y * (t * (z * -9.0))))
x, y, z, t, a, b = sort([x, y, z, t, a, b])
function code(x, y, z, t, a, b)
	return Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) + Float64(y * Float64(t * Float64(z * -9.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) + ((a * (27.0 * b)) + (y * (t * (z * -9.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[(N[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) + y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\right)
\end{array}
Derivation
  1. Initial program 95.6%

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

      \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
    2. associate-+l+N/A

      \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
    5. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
    7. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
    10. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
    11. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
    12. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
    14. associate-*r*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
    15. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
    16. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
    17. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
    18. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
    19. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
    20. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
    21. metadata-eval96.1%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
  3. Simplified96.1%

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

Alternative 2: 82.7% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := b \cdot \left(a \cdot 27\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+113}:\\ \;\;\;\;x \cdot 2 + t\_1\\ \mathbf{elif}\;t\_1 \leq 10^{+29}:\\ \;\;\;\;x \cdot 2 + -9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 + 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
 (let* ((t_1 (* b (* a 27.0))))
   (if (<= t_1 -2e+113)
     (+ (* x 2.0) t_1)
     (if (<= t_1 1e+29)
       (+ (* x 2.0) (* -9.0 (* y (* t z))))
       (+ (* 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 t_1 = b * (a * 27.0);
	double tmp;
	if (t_1 <= -2e+113) {
		tmp = (x * 2.0) + t_1;
	} else if (t_1 <= 1e+29) {
		tmp = (x * 2.0) + (-9.0 * (y * (t * z)));
	} else {
		tmp = (x * 2.0) + (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) :: t_1
    real(8) :: tmp
    t_1 = b * (a * 27.0d0)
    if (t_1 <= (-2d+113)) then
        tmp = (x * 2.0d0) + t_1
    else if (t_1 <= 1d+29) then
        tmp = (x * 2.0d0) + ((-9.0d0) * (y * (t * z)))
    else
        tmp = (x * 2.0d0) + (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 t_1 = b * (a * 27.0);
	double tmp;
	if (t_1 <= -2e+113) {
		tmp = (x * 2.0) + t_1;
	} else if (t_1 <= 1e+29) {
		tmp = (x * 2.0) + (-9.0 * (y * (t * z)));
	} else {
		tmp = (x * 2.0) + (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):
	t_1 = b * (a * 27.0)
	tmp = 0
	if t_1 <= -2e+113:
		tmp = (x * 2.0) + t_1
	elif t_1 <= 1e+29:
		tmp = (x * 2.0) + (-9.0 * (y * (t * z)))
	else:
		tmp = (x * 2.0) + (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)
	t_1 = Float64(b * Float64(a * 27.0))
	tmp = 0.0
	if (t_1 <= -2e+113)
		tmp = Float64(Float64(x * 2.0) + t_1);
	elseif (t_1 <= 1e+29)
		tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(y * Float64(t * z))));
	else
		tmp = Float64(Float64(x * 2.0) + 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)
	t_1 = b * (a * 27.0);
	tmp = 0.0;
	if (t_1 <= -2e+113)
		tmp = (x * 2.0) + t_1;
	elseif (t_1 <= 1e+29)
		tmp = (x * 2.0) + (-9.0 * (y * (t * z)));
	else
		tmp = (x * 2.0) + (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_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+113], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 1e+29], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $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 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+113}:\\
\;\;\;\;x \cdot 2 + t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -2e113

    1. Initial program 89.5%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(2 \cdot x\right)}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, 27\right), b\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f6485.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, x\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(a, 27\right)}, b\right)\right) \]
    5. Simplified85.5%

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

    if -2e113 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 9.99999999999999914e28

    1. Initial program 98.6%

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

        \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      2. associate-+l+N/A

        \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
      16. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
      19. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
    3. Simplified96.3%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \color{blue}{\left(-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{*.f64}\left(-9, \color{blue}{\left(t \cdot \left(y \cdot z\right)\right)}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{*.f64}\left(-9, \left(\left(y \cdot z\right) \cdot \color{blue}{t}\right)\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{*.f64}\left(-9, \left(y \cdot \color{blue}{\left(z \cdot t\right)}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{*.f64}\left(-9, \left(y \cdot \left(t \cdot \color{blue}{z}\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{*.f64}\left(-9, \mathsf{*.f64}\left(y, \color{blue}{\left(t \cdot z\right)}\right)\right)\right) \]
      6. *-lowering-*.f6482.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{*.f64}\left(-9, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{z}\right)\right)\right)\right) \]
    7. Simplified82.2%

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

    if 9.99999999999999914e28 < (*.f64 (*.f64 a #s(literal 27 binary64)) b)

    1. Initial program 91.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-negN/A

        \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      2. associate-+l+N/A

        \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
      16. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
      19. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
    3. Simplified93.5%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \color{blue}{\left(27 \cdot \left(a \cdot b\right)\right)}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{*.f64}\left(27, \color{blue}{\left(a \cdot b\right)}\right)\right) \]
      2. *-lowering-*.f6487.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \color{blue}{b}\right)\right)\right) \]
    7. Simplified87.4%

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

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

Alternative 3: 76.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 -2 \cdot 10^{-22}:\\ \;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\ \mathbf{elif}\;z \leq 8400000000:\\ \;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\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 -2e-22)
   (* y (* t (* z -9.0)))
   (if (<= z 8400000000.0)
     (+ (* x 2.0) (* b (* a 27.0)))
     (* z (* t (* y -9.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-22) {
		tmp = y * (t * (z * -9.0));
	} else if (z <= 8400000000.0) {
		tmp = (x * 2.0) + (b * (a * 27.0));
	} else {
		tmp = z * (t * (y * -9.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-22)) then
        tmp = y * (t * (z * (-9.0d0)))
    else if (z <= 8400000000.0d0) then
        tmp = (x * 2.0d0) + (b * (a * 27.0d0))
    else
        tmp = z * (t * (y * (-9.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-22) {
		tmp = y * (t * (z * -9.0));
	} else if (z <= 8400000000.0) {
		tmp = (x * 2.0) + (b * (a * 27.0));
	} else {
		tmp = z * (t * (y * -9.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-22:
		tmp = y * (t * (z * -9.0))
	elif z <= 8400000000.0:
		tmp = (x * 2.0) + (b * (a * 27.0))
	else:
		tmp = z * (t * (y * -9.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-22)
		tmp = Float64(y * Float64(t * Float64(z * -9.0)));
	elseif (z <= 8400000000.0)
		tmp = Float64(Float64(x * 2.0) + Float64(b * Float64(a * 27.0)));
	else
		tmp = Float64(z * Float64(t * Float64(y * -9.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-22)
		tmp = y * (t * (z * -9.0));
	elseif (z <= 8400000000.0)
		tmp = (x * 2.0) + (b * (a * 27.0));
	else
		tmp = z * (t * (y * -9.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-22], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8400000000.0], N[(N[(x * 2.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(y * -9.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^{-22}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\

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

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


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

    1. Initial program 92.6%

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

        \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      2. associate-+l+N/A

        \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
      16. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
      19. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      21. metadata-eval90.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
    3. Simplified90.0%

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

      \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-9, \color{blue}{\left(t \cdot \left(y \cdot z\right)\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(-9, \left(\left(y \cdot z\right) \cdot \color{blue}{t}\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(-9, \left(y \cdot \color{blue}{\left(z \cdot t\right)}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(-9, \left(y \cdot \left(t \cdot \color{blue}{z}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-9, \mathsf{*.f64}\left(y, \color{blue}{\left(t \cdot z\right)}\right)\right) \]
      6. *-lowering-*.f6452.4%

        \[\leadsto \mathsf{*.f64}\left(-9, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{z}\right)\right)\right) \]
    7. Simplified52.4%

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

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

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

        \[\leadsto \left(\left(-9 \cdot t\right) \cdot z\right) \cdot y \]
      4. *-commutativeN/A

        \[\leadsto \left(\left(t \cdot -9\right) \cdot z\right) \cdot y \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(t \cdot -9\right) \cdot z\right), \color{blue}{y}\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(t \cdot \left(-9 \cdot z\right)\right), y\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(-9 \cdot z\right)\right), y\right) \]
      8. *-lowering-*.f6452.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(-9, z\right)\right), y\right) \]
    9. Applied egg-rr52.4%

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

    if -2.0000000000000001e-22 < z < 8.4e9

    1. Initial program 98.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. Add Preprocessing
    3. Taylor expanded in x around inf

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(2 \cdot x\right)}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, 27\right), b\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f6478.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, x\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(a, 27\right)}, b\right)\right) \]
    5. Simplified78.7%

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

    if 8.4e9 < z

    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-negN/A

        \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      2. associate-+l+N/A

        \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
      16. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
      19. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      21. metadata-eval95.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
    3. Simplified95.2%

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

      \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-9, \color{blue}{\left(t \cdot \left(y \cdot z\right)\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(-9, \left(\left(y \cdot z\right) \cdot \color{blue}{t}\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(-9, \left(y \cdot \color{blue}{\left(z \cdot t\right)}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(-9, \left(y \cdot \left(t \cdot \color{blue}{z}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-9, \mathsf{*.f64}\left(y, \color{blue}{\left(t \cdot z\right)}\right)\right) \]
      6. *-lowering-*.f6454.9%

        \[\leadsto \mathsf{*.f64}\left(-9, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{z}\right)\right)\right) \]
    7. Simplified54.9%

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

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

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

        \[\leadsto \left(\left(-9 \cdot t\right) \cdot z\right) \cdot y \]
      4. *-commutativeN/A

        \[\leadsto \left(\left(t \cdot -9\right) \cdot z\right) \cdot y \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(t \cdot -9\right) \cdot z\right), \color{blue}{y}\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(t \cdot \left(-9 \cdot z\right)\right), y\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(-9 \cdot z\right)\right), y\right) \]
      8. *-lowering-*.f6454.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(-9, z\right)\right), y\right) \]
    9. Applied egg-rr54.9%

      \[\leadsto \color{blue}{\left(t \cdot \left(-9 \cdot z\right)\right) \cdot y} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \left(y \cdot \left(t \cdot z\right)\right) \cdot \color{blue}{-9} \]
      5. *-commutativeN/A

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

        \[\leadsto \left(-9 \cdot y\right) \cdot \color{blue}{\left(t \cdot z\right)} \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(-9 \cdot y\right) \cdot t\right) \cdot \color{blue}{z} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(-9 \cdot y\right) \cdot t\right), \color{blue}{z}\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(-9 \cdot y\right), t\right), z\right) \]
      10. *-lowering-*.f6454.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-9, y\right), t\right), z\right) \]
    11. Applied egg-rr54.9%

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

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

Alternative 4: 48.3% accurate, 1.0× 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}\;b \leq -5.8 \cdot 10^{-26}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 2.7 \cdot 10^{+94}:\\ \;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (<= b -5.8e-26) t_1 (if (<= b 2.7e+94) (* y (* t (* z -9.0))) t_1))))
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 (b <= -5.8e-26) {
		tmp = t_1;
	} else if (b <= 2.7e+94) {
		tmp = y * (t * (z * -9.0));
	} else {
		tmp = t_1;
	}
	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 (b <= (-5.8d-26)) then
        tmp = t_1
    else if (b <= 2.7d+94) then
        tmp = y * (t * (z * (-9.0d0)))
    else
        tmp = t_1
    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 (b <= -5.8e-26) {
		tmp = t_1;
	} else if (b <= 2.7e+94) {
		tmp = y * (t * (z * -9.0));
	} else {
		tmp = t_1;
	}
	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 b <= -5.8e-26:
		tmp = t_1
	elif b <= 2.7e+94:
		tmp = y * (t * (z * -9.0))
	else:
		tmp = t_1
	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 (b <= -5.8e-26)
		tmp = t_1;
	elseif (b <= 2.7e+94)
		tmp = Float64(y * Float64(t * Float64(z * -9.0)));
	else
		tmp = t_1;
	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 (b <= -5.8e-26)
		tmp = t_1;
	elseif (b <= 2.7e+94)
		tmp = y * (t * (z * -9.0));
	else
		tmp = t_1;
	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[b, -5.8e-26], t$95$1, If[LessEqual[b, 2.7e+94], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\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}\;b \leq -5.8 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 2.7 \cdot 10^{+94}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -5.7999999999999996e-26 or 2.7000000000000001e94 < b

    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-negN/A

        \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      2. associate-+l+N/A

        \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
      16. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
      19. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      21. metadata-eval96.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
    3. Simplified96.2%

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(27, \color{blue}{\left(a \cdot b\right)}\right) \]
      2. *-lowering-*.f6464.9%

        \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \color{blue}{b}\right)\right) \]
    7. Simplified64.9%

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

    if -5.7999999999999996e-26 < b < 2.7000000000000001e94

    1. Initial program 95.2%

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

        \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      2. associate-+l+N/A

        \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
      16. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
      19. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      21. metadata-eval96.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
    3. Simplified96.0%

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

      \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-9, \color{blue}{\left(t \cdot \left(y \cdot z\right)\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(-9, \left(\left(y \cdot z\right) \cdot \color{blue}{t}\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(-9, \left(y \cdot \color{blue}{\left(z \cdot t\right)}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(-9, \left(y \cdot \left(t \cdot \color{blue}{z}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-9, \mathsf{*.f64}\left(y, \color{blue}{\left(t \cdot z\right)}\right)\right) \]
      6. *-lowering-*.f6446.8%

        \[\leadsto \mathsf{*.f64}\left(-9, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{z}\right)\right)\right) \]
    7. Simplified46.8%

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

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

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

        \[\leadsto \left(\left(-9 \cdot t\right) \cdot z\right) \cdot y \]
      4. *-commutativeN/A

        \[\leadsto \left(\left(t \cdot -9\right) \cdot z\right) \cdot y \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(t \cdot -9\right) \cdot z\right), \color{blue}{y}\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(t \cdot \left(-9 \cdot z\right)\right), y\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(-9 \cdot z\right)\right), y\right) \]
      8. *-lowering-*.f6446.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(-9, z\right)\right), y\right) \]
    9. Applied egg-rr46.8%

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

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

Alternative 5: 48.3% accurate, 1.0× 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}\;b \leq -3.3 \cdot 10^{-26}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{+94}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (<= b -3.3e-26) t_1 (if (<= b 1.5e+94) (* -9.0 (* y (* t z))) t_1))))
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 (b <= -3.3e-26) {
		tmp = t_1;
	} else if (b <= 1.5e+94) {
		tmp = -9.0 * (y * (t * z));
	} else {
		tmp = t_1;
	}
	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 (b <= (-3.3d-26)) then
        tmp = t_1
    else if (b <= 1.5d+94) then
        tmp = (-9.0d0) * (y * (t * z))
    else
        tmp = t_1
    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 (b <= -3.3e-26) {
		tmp = t_1;
	} else if (b <= 1.5e+94) {
		tmp = -9.0 * (y * (t * z));
	} else {
		tmp = t_1;
	}
	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 b <= -3.3e-26:
		tmp = t_1
	elif b <= 1.5e+94:
		tmp = -9.0 * (y * (t * z))
	else:
		tmp = t_1
	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 (b <= -3.3e-26)
		tmp = t_1;
	elseif (b <= 1.5e+94)
		tmp = Float64(-9.0 * Float64(y * Float64(t * z)));
	else
		tmp = t_1;
	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 (b <= -3.3e-26)
		tmp = t_1;
	elseif (b <= 1.5e+94)
		tmp = -9.0 * (y * (t * z));
	else
		tmp = t_1;
	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[b, -3.3e-26], t$95$1, If[LessEqual[b, 1.5e+94], N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\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}\;b \leq -3.3 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 1.5 \cdot 10^{+94}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.2999999999999998e-26 or 1.5e94 < b

    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-negN/A

        \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      2. associate-+l+N/A

        \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
      16. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
      19. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      21. metadata-eval96.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
    3. Simplified96.2%

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(27, \color{blue}{\left(a \cdot b\right)}\right) \]
      2. *-lowering-*.f6464.9%

        \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \color{blue}{b}\right)\right) \]
    7. Simplified64.9%

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

    if -3.2999999999999998e-26 < b < 1.5e94

    1. Initial program 95.2%

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

        \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      2. associate-+l+N/A

        \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
      16. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
      19. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      21. metadata-eval96.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
    3. Simplified96.0%

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

      \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-9, \color{blue}{\left(t \cdot \left(y \cdot z\right)\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(-9, \left(\left(y \cdot z\right) \cdot \color{blue}{t}\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(-9, \left(y \cdot \color{blue}{\left(z \cdot t\right)}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(-9, \left(y \cdot \left(t \cdot \color{blue}{z}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-9, \mathsf{*.f64}\left(y, \color{blue}{\left(t \cdot z\right)}\right)\right) \]
      6. *-lowering-*.f6446.8%

        \[\leadsto \mathsf{*.f64}\left(-9, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{z}\right)\right)\right) \]
    7. Simplified46.8%

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

Alternative 6: 46.0% accurate, 1.1× 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 -0.008:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{-135}:\\ \;\;\;\;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 -0.008)
   (* b (* a 27.0))
   (if (<= a 7.2e-135) (* 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 <= -0.008) {
		tmp = b * (a * 27.0);
	} else if (a <= 7.2e-135) {
		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 <= (-0.008d0)) then
        tmp = b * (a * 27.0d0)
    else if (a <= 7.2d-135) 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 <= -0.008) {
		tmp = b * (a * 27.0);
	} else if (a <= 7.2e-135) {
		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 <= -0.008:
		tmp = b * (a * 27.0)
	elif a <= 7.2e-135:
		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 <= -0.008)
		tmp = Float64(b * Float64(a * 27.0));
	elseif (a <= 7.2e-135)
		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 <= -0.008)
		tmp = b * (a * 27.0);
	elseif (a <= 7.2e-135)
		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, -0.008], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.2e-135], 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 -0.008:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\

\mathbf{elif}\;a \leq 7.2 \cdot 10^{-135}:\\
\;\;\;\;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 < -0.0080000000000000002

    1. Initial program 91.5%

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

        \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      2. associate-+l+N/A

        \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
      16. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
      19. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      21. metadata-eval93.6%

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

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(27, \color{blue}{\left(a \cdot b\right)}\right) \]
      2. *-lowering-*.f6457.2%

        \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \color{blue}{b}\right)\right) \]
    7. Simplified57.2%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    8. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(27 \cdot a\right) \cdot \color{blue}{b} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(27 \cdot a\right), \color{blue}{b}\right) \]
      3. *-lowering-*.f6457.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(27, a\right), b\right) \]
    9. Applied egg-rr57.3%

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

    if -0.0080000000000000002 < a < 7.19999999999999955e-135

    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. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      2. associate-+l+N/A

        \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
      16. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
      19. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      21. metadata-eval95.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
    3. Simplified95.8%

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

      \[\leadsto \color{blue}{2 \cdot x} \]
    6. Step-by-step derivation
      1. *-lowering-*.f6441.9%

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{x}\right) \]
    7. Simplified41.9%

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

    if 7.19999999999999955e-135 < a

    1. Initial program 95.9%

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

        \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      2. associate-+l+N/A

        \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
      16. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
      19. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      21. metadata-eval97.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
    3. Simplified97.9%

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(27, \color{blue}{\left(a \cdot b\right)}\right) \]
      2. *-lowering-*.f6447.1%

        \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \color{blue}{b}\right)\right) \]
    7. Simplified47.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -0.008:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{-135}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 46.0% accurate, 1.1× 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}\;a \leq -0.0065:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{-137}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (<= a -0.0065) t_1 (if (<= a 1.3e-137) (* x 2.0) t_1))))
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 (a <= -0.0065) {
		tmp = t_1;
	} else if (a <= 1.3e-137) {
		tmp = x * 2.0;
	} else {
		tmp = t_1;
	}
	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 (a <= (-0.0065d0)) then
        tmp = t_1
    else if (a <= 1.3d-137) then
        tmp = x * 2.0d0
    else
        tmp = t_1
    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 (a <= -0.0065) {
		tmp = t_1;
	} else if (a <= 1.3e-137) {
		tmp = x * 2.0;
	} else {
		tmp = t_1;
	}
	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 a <= -0.0065:
		tmp = t_1
	elif a <= 1.3e-137:
		tmp = x * 2.0
	else:
		tmp = t_1
	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 (a <= -0.0065)
		tmp = t_1;
	elseif (a <= 1.3e-137)
		tmp = Float64(x * 2.0);
	else
		tmp = t_1;
	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 (a <= -0.0065)
		tmp = t_1;
	elseif (a <= 1.3e-137)
		tmp = x * 2.0;
	else
		tmp = t_1;
	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[a, -0.0065], t$95$1, If[LessEqual[a, 1.3e-137], N[(x * 2.0), $MachinePrecision], t$95$1]]]
\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}\;a \leq -0.0065:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.3 \cdot 10^{-137}:\\
\;\;\;\;x \cdot 2\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -0.0064999999999999997 or 1.3e-137 < a

    1. Initial program 94.3%

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

        \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      2. associate-+l+N/A

        \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
      16. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
      19. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
    3. Simplified96.3%

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(27, \color{blue}{\left(a \cdot b\right)}\right) \]
      2. *-lowering-*.f6451.0%

        \[\leadsto \mathsf{*.f64}\left(27, \mathsf{*.f64}\left(a, \color{blue}{b}\right)\right) \]
    7. Simplified51.0%

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

    if -0.0064999999999999997 < a < 1.3e-137

    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. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      2. associate-+l+N/A

        \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
      16. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
      19. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
      21. metadata-eval95.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
    3. Simplified95.8%

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

      \[\leadsto \color{blue}{2 \cdot x} \]
    6. Step-by-step derivation
      1. *-lowering-*.f6441.9%

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{x}\right) \]
    7. Simplified41.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -0.0065:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{-137}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 30.5% 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 95.6%

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

      \[\leadsto \left(x \cdot 2 + \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)\right) + \color{blue}{\left(a \cdot 27\right)} \cdot b \]
    2. associate-+l+N/A

      \[\leadsto x \cdot 2 + \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)} \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) + \left(a \cdot 27\right) \cdot b\right)}\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b\right)\right) \]
    5. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(\left(a \cdot 27\right) \cdot b + \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(\left(a \cdot 27\right) \cdot b\right), \color{blue}{\left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)}\right)\right) \]
    7. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\left(a \cdot \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(27 \cdot b\right)\right), \left(\mathsf{neg}\left(\color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right)\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot \color{blue}{t}\right)\right)\right)\right) \]
    10. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\right)\right)\right) \]
    11. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(\mathsf{neg}\left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\right)\right)\right) \]
    12. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \left(y \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left(\mathsf{neg}\left(9 \cdot \left(z \cdot t\right)\right)\right)}\right)\right)\right) \]
    14. associate-*r*N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(\left(9 \cdot z\right) \cdot t\right)\right)\right)\right)\right) \]
    15. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left(t \cdot \left(9 \cdot z\right)\right)\right)\right)\right)\right) \]
    16. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \left(t \cdot \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
    17. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(9 \cdot z\right)\right)}\right)\right)\right)\right) \]
    18. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(\mathsf{neg}\left(z \cdot 9\right)\right)\right)\right)\right)\right) \]
    19. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \left(z \cdot \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
    20. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, \color{blue}{\left(\mathsf{neg}\left(9\right)\right)}\right)\right)\right)\right)\right) \]
    21. metadata-eval96.1%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(27, b\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(z, -9\right)\right)\right)\right)\right) \]
  3. Simplified96.1%

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

    \[\leadsto \color{blue}{2 \cdot x} \]
  6. Step-by-step derivation
    1. *-lowering-*.f6427.1%

      \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{x}\right) \]
  7. Simplified27.1%

    \[\leadsto \color{blue}{2 \cdot x} \]
  8. Final simplification27.1%

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

Developer Target 1: 94.9% 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 2024145 
(FPCore (x y z t a b)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, A"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< y 7590524218811189/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x 2) (* (* (* y 9) z) t)) (* a (* 27 b))) (+ (- (* x 2) (* 9 (* y (* t z)))) (* (* a 27) b))))

  (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))