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

Percentage Accurate: 95.8% → 98.8%
Time: 11.9s
Alternatives: 16
Speedup: 0.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 95.8% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.0999999999999999e-116

    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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot y, -9 \cdot z, \mathsf{fma}\left(b \cdot 27, a, \color{blue}{2 \cdot x}\right)\right) \]
      2. count-2-revN/A

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

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

      \[\leadsto \mathsf{fma}\left(t \cdot y, -9 \cdot z, \mathsf{fma}\left(b \cdot 27, a, \color{blue}{x + x}\right)\right) \]
    7. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0999999999999999e-116 < t

    1. Initial program 99.8%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{2 \cdot x} - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      6. count-2-revN/A

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

        \[\leadsto \color{blue}{x + \left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
      8. lower-+.f64N/A

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

        \[\leadsto x + \color{blue}{\left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
      10. lift-*.f64N/A

        \[\leadsto x + \left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \color{blue}{\left(a \cdot 27\right) \cdot b}\right)\right) \]
      11. fp-cancel-sub-sign-invN/A

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

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

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

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

        \[\leadsto x + \left(x - \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right), b, \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) \]
      16. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 82.1% 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 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+82} \lor \neg \left(t\_1 \leq 4 \cdot 10^{-110}\right):\\ \;\;\;\;x + \mathsf{fma}\left(-9, \left(y \cdot t\right) \cdot z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x\right) + x\\ \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 (* (* (* y 9.0) z) t)))
   (if (or (<= t_1 -1e+82) (not (<= t_1 4e-110)))
     (+ x (fma -9.0 (* (* y t) z) x))
     (+ (fma (* 27.0 b) a x) x))))
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 = ((y * 9.0) * z) * t;
	double tmp;
	if ((t_1 <= -1e+82) || !(t_1 <= 4e-110)) {
		tmp = x + fma(-9.0, ((y * t) * z), x);
	} else {
		tmp = fma((27.0 * b), a, x) + x;
	}
	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(Float64(Float64(y * 9.0) * z) * t)
	tmp = 0.0
	if ((t_1 <= -1e+82) || !(t_1 <= 4e-110))
		tmp = Float64(x + fma(-9.0, Float64(Float64(y * t) * z), x));
	else
		tmp = Float64(fma(Float64(27.0 * b), a, x) + x);
	end
	return tmp
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+82], N[Not[LessEqual[t$95$1, 4e-110]], $MachinePrecision]], N[(x + N[(-9.0 * N[(N[(y * t), $MachinePrecision] * z), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(27.0 * b), $MachinePrecision] * a + x), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+82} \lor \neg \left(t\_1 \leq 4 \cdot 10^{-110}\right):\\
\;\;\;\;x + \mathsf{fma}\left(-9, \left(y \cdot t\right) \cdot z, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -9.9999999999999996e81 or 4.0000000000000002e-110 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

    1. Initial program 95.4%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{2 \cdot x} - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      6. count-2-revN/A

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

        \[\leadsto \color{blue}{x + \left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
      8. lower-+.f64N/A

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

        \[\leadsto x + \color{blue}{\left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
      10. lift-*.f64N/A

        \[\leadsto x + \left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \color{blue}{\left(a \cdot 27\right) \cdot b}\right)\right) \]
      11. fp-cancel-sub-sign-invN/A

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

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

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

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

        \[\leadsto x + \left(x - \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right), b, \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) \]
      16. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto x + \left(x - \color{blue}{\left(\mathsf{neg}\left(-9\right)\right)} \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
      2. fp-cancel-sign-sub-invN/A

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

        \[\leadsto x + \color{blue}{\left(-9 \cdot \left(t \cdot \left(y \cdot z\right)\right) + x\right)} \]
      4. lower-fma.f64N/A

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

        \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, x\right) \]
      6. lower-*.f64N/A

        \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, x\right) \]
      7. lower-*.f6485.4

        \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right)} \cdot t, x\right) \]
    7. Applied rewrites85.4%

      \[\leadsto x + \color{blue}{\mathsf{fma}\left(-9, \left(y \cdot z\right) \cdot t, x\right)} \]
    8. Step-by-step derivation
      1. Applied rewrites80.1%

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

      if -9.9999999999999996e81 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 4.0000000000000002e-110

      1. Initial program 99.8%

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

        \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
      4. Step-by-step derivation
        1. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
        3. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
        5. lower-*.f6494.9

          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
      5. Applied rewrites94.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
      6. Step-by-step derivation
        1. Applied rewrites94.9%

          \[\leadsto \mathsf{fma}\left(27 \cdot b, a, x\right) + \color{blue}{x} \]
      7. Recombined 2 regimes into one program.
      8. Final simplification87.1%

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

      Alternative 3: 83.4% 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 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+33}:\\ \;\;\;\;\mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \left(b \cdot a\right) \cdot 27\right)\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-110}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x\right) + x\\ \mathbf{else}:\\ \;\;\;\;x + \mathsf{fma}\left(-9, \left(y \cdot t\right) \cdot z, x\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 (* (* (* y 9.0) z) t)))
         (if (<= t_1 -5e+33)
           (fma -9.0 (* (* z y) t) (* (* b a) 27.0))
           (if (<= t_1 4e-110)
             (+ (fma (* 27.0 b) a x) x)
             (+ x (fma -9.0 (* (* y t) z) x))))))
      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 = ((y * 9.0) * z) * t;
      	double tmp;
      	if (t_1 <= -5e+33) {
      		tmp = fma(-9.0, ((z * y) * t), ((b * a) * 27.0));
      	} else if (t_1 <= 4e-110) {
      		tmp = fma((27.0 * b), a, x) + x;
      	} else {
      		tmp = x + fma(-9.0, ((y * t) * z), x);
      	}
      	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(Float64(Float64(y * 9.0) * z) * t)
      	tmp = 0.0
      	if (t_1 <= -5e+33)
      		tmp = fma(-9.0, Float64(Float64(z * y) * t), Float64(Float64(b * a) * 27.0));
      	elseif (t_1 <= 4e-110)
      		tmp = Float64(fma(Float64(27.0 * b), a, x) + x);
      	else
      		tmp = Float64(x + fma(-9.0, Float64(Float64(y * t) * z), x));
      	end
      	return tmp
      end
      
      NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+33], N[(-9.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e-110], N[(N[(N[(27.0 * b), $MachinePrecision] * a + x), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(-9.0 * N[(N[(y * t), $MachinePrecision] * z), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
      \\
      \begin{array}{l}
      t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
      \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+33}:\\
      \;\;\;\;\mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \left(b \cdot a\right) \cdot 27\right)\\
      
      \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-110}:\\
      \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x\right) + x\\
      
      \mathbf{else}:\\
      \;\;\;\;x + \mathsf{fma}\left(-9, \left(y \cdot t\right) \cdot z, x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.99999999999999973e33

        1. Initial program 96.9%

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

          \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
        4. Step-by-step derivation
          1. fp-cancel-sub-sign-invN/A

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

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

            \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right) + 27 \cdot \left(a \cdot b\right)} \]
          4. lower-fma.f64N/A

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

            \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, 27 \cdot \left(a \cdot b\right)\right) \]
          6. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, 27 \cdot \left(a \cdot b\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(z \cdot y\right)} \cdot t, 27 \cdot \left(a \cdot b\right)\right) \]
          8. lower-*.f64N/A

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

            \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
          10. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
          11. *-commutativeN/A

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

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

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

        if -4.99999999999999973e33 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 4.0000000000000002e-110

        1. Initial program 99.8%

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

          \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
        4. Step-by-step derivation
          1. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
          3. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
          5. lower-*.f6496.5

            \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
        5. Applied rewrites96.5%

          \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
        6. Step-by-step derivation
          1. Applied rewrites96.5%

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

          if 4.0000000000000002e-110 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

          1. Initial program 94.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. Add Preprocessing
          3. Step-by-step derivation
            1. lift-+.f64N/A

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

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

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

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

              \[\leadsto \color{blue}{2 \cdot x} - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
            6. count-2-revN/A

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

              \[\leadsto \color{blue}{x + \left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
            8. lower-+.f64N/A

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

              \[\leadsto x + \color{blue}{\left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
            10. lift-*.f64N/A

              \[\leadsto x + \left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \color{blue}{\left(a \cdot 27\right) \cdot b}\right)\right) \]
            11. fp-cancel-sub-sign-invN/A

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

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

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

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

              \[\leadsto x + \left(x - \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right), b, \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) \]
            16. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto x + \color{blue}{\left(x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} \]
          6. Step-by-step derivation
            1. metadata-evalN/A

              \[\leadsto x + \left(x - \color{blue}{\left(\mathsf{neg}\left(-9\right)\right)} \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
            2. fp-cancel-sign-sub-invN/A

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

              \[\leadsto x + \color{blue}{\left(-9 \cdot \left(t \cdot \left(y \cdot z\right)\right) + x\right)} \]
            4. lower-fma.f64N/A

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

              \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, x\right) \]
            6. lower-*.f64N/A

              \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, x\right) \]
            7. lower-*.f6482.0

              \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right)} \cdot t, x\right) \]
          7. Applied rewrites82.0%

            \[\leadsto x + \color{blue}{\mathsf{fma}\left(-9, \left(y \cdot z\right) \cdot t, x\right)} \]
          8. Step-by-step derivation
            1. Applied rewrites78.6%

              \[\leadsto x + \mathsf{fma}\left(-9, \left(y \cdot t\right) \cdot \color{blue}{z}, x\right) \]
          9. Recombined 3 regimes into one program.
          10. Add Preprocessing

          Alternative 4: 83.3% 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 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+82}:\\ \;\;\;\;x + \mathsf{fma}\left(-9, \left(y \cdot z\right) \cdot t, x\right)\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-110}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x\right) + x\\ \mathbf{else}:\\ \;\;\;\;x + \mathsf{fma}\left(-9, \left(y \cdot t\right) \cdot z, x\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 (* (* (* y 9.0) z) t)))
             (if (<= t_1 -1e+82)
               (+ x (fma -9.0 (* (* y z) t) x))
               (if (<= t_1 4e-110)
                 (+ (fma (* 27.0 b) a x) x)
                 (+ x (fma -9.0 (* (* y t) z) x))))))
          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 = ((y * 9.0) * z) * t;
          	double tmp;
          	if (t_1 <= -1e+82) {
          		tmp = x + fma(-9.0, ((y * z) * t), x);
          	} else if (t_1 <= 4e-110) {
          		tmp = fma((27.0 * b), a, x) + x;
          	} else {
          		tmp = x + fma(-9.0, ((y * t) * z), x);
          	}
          	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(Float64(Float64(y * 9.0) * z) * t)
          	tmp = 0.0
          	if (t_1 <= -1e+82)
          		tmp = Float64(x + fma(-9.0, Float64(Float64(y * z) * t), x));
          	elseif (t_1 <= 4e-110)
          		tmp = Float64(fma(Float64(27.0 * b), a, x) + x);
          	else
          		tmp = Float64(x + fma(-9.0, Float64(Float64(y * t) * z), x));
          	end
          	return tmp
          end
          
          NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
          code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+82], N[(x + N[(-9.0 * N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e-110], N[(N[(N[(27.0 * b), $MachinePrecision] * a + x), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(-9.0 * N[(N[(y * t), $MachinePrecision] * z), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
          \\
          \begin{array}{l}
          t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
          \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+82}:\\
          \;\;\;\;x + \mathsf{fma}\left(-9, \left(y \cdot z\right) \cdot t, x\right)\\
          
          \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-110}:\\
          \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x\right) + x\\
          
          \mathbf{else}:\\
          \;\;\;\;x + \mathsf{fma}\left(-9, \left(y \cdot t\right) \cdot z, x\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -9.9999999999999996e81

            1. Initial program 96.5%

              \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

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

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

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

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

                \[\leadsto \color{blue}{2 \cdot x} - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
              6. count-2-revN/A

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

                \[\leadsto \color{blue}{x + \left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
              8. lower-+.f64N/A

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

                \[\leadsto x + \color{blue}{\left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
              10. lift-*.f64N/A

                \[\leadsto x + \left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \color{blue}{\left(a \cdot 27\right) \cdot b}\right)\right) \]
              11. fp-cancel-sub-sign-invN/A

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

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

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

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

                \[\leadsto x + \left(x - \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right), b, \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) \]
              16. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto x + \color{blue}{\left(x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} \]
            6. Step-by-step derivation
              1. metadata-evalN/A

                \[\leadsto x + \left(x - \color{blue}{\left(\mathsf{neg}\left(-9\right)\right)} \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
              2. fp-cancel-sign-sub-invN/A

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

                \[\leadsto x + \color{blue}{\left(-9 \cdot \left(t \cdot \left(y \cdot z\right)\right) + x\right)} \]
              4. lower-fma.f64N/A

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

                \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, x\right) \]
              6. lower-*.f64N/A

                \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, x\right) \]
              7. lower-*.f6490.0

                \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right)} \cdot t, x\right) \]
            7. Applied rewrites90.0%

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

            if -9.9999999999999996e81 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 4.0000000000000002e-110

            1. Initial program 99.8%

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

              \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
            4. Step-by-step derivation
              1. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
              2. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
              3. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
              4. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
              5. lower-*.f6494.9

                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
            5. Applied rewrites94.9%

              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
            6. Step-by-step derivation
              1. Applied rewrites94.9%

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

              if 4.0000000000000002e-110 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

              1. Initial program 94.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. Add Preprocessing
              3. Step-by-step derivation
                1. lift-+.f64N/A

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

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

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

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

                  \[\leadsto \color{blue}{2 \cdot x} - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
                6. count-2-revN/A

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

                  \[\leadsto \color{blue}{x + \left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
                8. lower-+.f64N/A

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

                  \[\leadsto x + \color{blue}{\left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
                10. lift-*.f64N/A

                  \[\leadsto x + \left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \color{blue}{\left(a \cdot 27\right) \cdot b}\right)\right) \]
                11. fp-cancel-sub-sign-invN/A

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

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

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

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

                  \[\leadsto x + \left(x - \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right), b, \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) \]
                16. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \color{blue}{\left(x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} \]
              6. Step-by-step derivation
                1. metadata-evalN/A

                  \[\leadsto x + \left(x - \color{blue}{\left(\mathsf{neg}\left(-9\right)\right)} \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
                2. fp-cancel-sign-sub-invN/A

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

                  \[\leadsto x + \color{blue}{\left(-9 \cdot \left(t \cdot \left(y \cdot z\right)\right) + x\right)} \]
                4. lower-fma.f64N/A

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

                  \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, x\right) \]
                6. lower-*.f64N/A

                  \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, x\right) \]
                7. lower-*.f6482.0

                  \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right)} \cdot t, x\right) \]
              7. Applied rewrites82.0%

                \[\leadsto x + \color{blue}{\mathsf{fma}\left(-9, \left(y \cdot z\right) \cdot t, x\right)} \]
              8. Step-by-step derivation
                1. Applied rewrites78.6%

                  \[\leadsto x + \mathsf{fma}\left(-9, \left(y \cdot t\right) \cdot \color{blue}{z}, x\right) \]
              9. Recombined 3 regimes into one program.
              10. Add Preprocessing

              Alternative 5: 83.2% 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 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+116} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+123}\right):\\ \;\;\;\;x + \left(\left(z \cdot y\right) \cdot t\right) \cdot -9\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)\\ \end{array} \end{array} \]
              NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
              (FPCore (x y z t a b)
               :precision binary64
               (let* ((t_1 (* (* (* y 9.0) z) t)))
                 (if (or (<= t_1 -2e+116) (not (<= t_1 4e+123)))
                   (+ x (* (* (* z y) t) -9.0))
                   (fma 2.0 x (* (* b a) 27.0)))))
              assert(x < y && y < z && z < t && t < a && a < b);
              double code(double x, double y, double z, double t, double a, double b) {
              	double t_1 = ((y * 9.0) * z) * t;
              	double tmp;
              	if ((t_1 <= -2e+116) || !(t_1 <= 4e+123)) {
              		tmp = x + (((z * y) * t) * -9.0);
              	} else {
              		tmp = fma(2.0, x, ((b * a) * 27.0));
              	}
              	return tmp;
              }
              
              x, y, z, t, a, b = sort([x, y, z, t, a, b])
              function code(x, y, z, t, a, b)
              	t_1 = Float64(Float64(Float64(y * 9.0) * z) * t)
              	tmp = 0.0
              	if ((t_1 <= -2e+116) || !(t_1 <= 4e+123))
              		tmp = Float64(x + Float64(Float64(Float64(z * y) * t) * -9.0));
              	else
              		tmp = fma(2.0, x, Float64(Float64(b * a) * 27.0));
              	end
              	return tmp
              end
              
              NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
              code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+116], N[Not[LessEqual[t$95$1, 4e+123]], $MachinePrecision]], N[(x + N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision], N[(2.0 * x + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
              \\
              \begin{array}{l}
              t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
              \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+116} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+123}\right):\\
              \;\;\;\;x + \left(\left(z \cdot y\right) \cdot t\right) \cdot -9\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -2.00000000000000003e116 or 3.99999999999999991e123 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                1. Initial program 93.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. Step-by-step derivation
                  1. lift-+.f64N/A

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

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

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

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

                    \[\leadsto \color{blue}{2 \cdot x} - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
                  6. count-2-revN/A

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

                    \[\leadsto \color{blue}{x + \left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
                  8. lower-+.f64N/A

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

                    \[\leadsto x + \color{blue}{\left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
                  10. lift-*.f64N/A

                    \[\leadsto x + \left(x - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \color{blue}{\left(a \cdot 27\right) \cdot b}\right)\right) \]
                  11. fp-cancel-sub-sign-invN/A

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

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

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

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

                    \[\leadsto x + \left(x - \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{27 \cdot a}\right), b, \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) \]
                  16. distribute-lft-neg-inN/A

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

                    \[\leadsto x + \left(x - \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot a}, b, \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right) \]
                  18. metadata-eval95.9

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto x + \color{blue}{\left(x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} \]
                6. Step-by-step derivation
                  1. metadata-evalN/A

                    \[\leadsto x + \left(x - \color{blue}{\left(\mathsf{neg}\left(-9\right)\right)} \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
                  2. fp-cancel-sign-sub-invN/A

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

                    \[\leadsto x + \color{blue}{\left(-9 \cdot \left(t \cdot \left(y \cdot z\right)\right) + x\right)} \]
                  4. lower-fma.f64N/A

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

                    \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, x\right) \]
                  6. lower-*.f64N/A

                    \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, x\right) \]
                  7. lower-*.f6490.2

                    \[\leadsto x + \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right)} \cdot t, x\right) \]
                7. Applied rewrites90.2%

                  \[\leadsto x + \color{blue}{\mathsf{fma}\left(-9, \left(y \cdot z\right) \cdot t, x\right)} \]
                8. Taylor expanded in x around 0

                  \[\leadsto x + -9 \cdot \color{blue}{\left(t \cdot \left(y \cdot z\right)\right)} \]
                9. Step-by-step derivation
                  1. Applied rewrites83.6%

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

                  if -2.00000000000000003e116 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 3.99999999999999991e123

                  1. Initial program 99.7%

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

                    \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                  4. Step-by-step derivation
                    1. lower-fma.f64N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                    2. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                    3. lower-*.f64N/A

                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                    4. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                    5. lower-*.f6486.5

                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                  5. Applied rewrites86.5%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                10. Recombined 2 regimes into one program.
                11. Final simplification85.4%

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

                Alternative 6: 82.9% 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 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+145} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+123}\right):\\ \;\;\;\;\left(\left(z \cdot y\right) \cdot t\right) \cdot -9\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)\\ \end{array} \end{array} \]
                NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                (FPCore (x y z t a b)
                 :precision binary64
                 (let* ((t_1 (* (* (* y 9.0) z) t)))
                   (if (or (<= t_1 -5e+145) (not (<= t_1 4e+123)))
                     (* (* (* z y) t) -9.0)
                     (fma 2.0 x (* (* b a) 27.0)))))
                assert(x < y && y < z && z < t && t < a && a < b);
                double code(double x, double y, double z, double t, double a, double b) {
                	double t_1 = ((y * 9.0) * z) * t;
                	double tmp;
                	if ((t_1 <= -5e+145) || !(t_1 <= 4e+123)) {
                		tmp = ((z * y) * t) * -9.0;
                	} else {
                		tmp = fma(2.0, x, ((b * a) * 27.0));
                	}
                	return tmp;
                }
                
                x, y, z, t, a, b = sort([x, y, z, t, a, b])
                function code(x, y, z, t, a, b)
                	t_1 = Float64(Float64(Float64(y * 9.0) * z) * t)
                	tmp = 0.0
                	if ((t_1 <= -5e+145) || !(t_1 <= 4e+123))
                		tmp = Float64(Float64(Float64(z * y) * t) * -9.0);
                	else
                		tmp = fma(2.0, x, Float64(Float64(b * a) * 27.0));
                	end
                	return tmp
                end
                
                NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+145], N[Not[LessEqual[t$95$1, 4e+123]], $MachinePrecision]], N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * -9.0), $MachinePrecision], N[(2.0 * x + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                \\
                \begin{array}{l}
                t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
                \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+145} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+123}\right):\\
                \;\;\;\;\left(\left(z \cdot y\right) \cdot t\right) \cdot -9\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.99999999999999967e145 or 3.99999999999999991e123 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                  1. Initial program 93.7%

                    \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(t \cdot y, -9 \cdot z, \mathsf{fma}\left(b \cdot 27, a, \color{blue}{2 \cdot x}\right)\right) \]
                    2. count-2-revN/A

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

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

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

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

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

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

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

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

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

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

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

                  if -4.99999999999999967e145 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 3.99999999999999991e123

                  1. Initial program 99.7%

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

                    \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                  4. Step-by-step derivation
                    1. lower-fma.f64N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                    2. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                    3. lower-*.f64N/A

                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                    4. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                    5. lower-*.f6485.6

                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                  5. Applied rewrites85.6%

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

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

                Alternative 7: 83.4% 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 := \left(y \cdot 9\right) \cdot z\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-42}:\\ \;\;\;\;\left(\left(-9 \cdot z\right) \cdot y\right) \cdot t + \left(a \cdot 27\right) \cdot b\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot a, b, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z\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 (* (* y 9.0) z)))
                   (if (<= t_1 -4e-42)
                     (+ (* (* (* -9.0 z) y) t) (* (* a 27.0) b))
                     (if (<= t_1 2e-23)
                       (+ (fma (* 27.0 b) a x) x)
                       (fma (* 27.0 a) b (* (* (* -9.0 y) t) z))))))
                assert(x < y && y < z && z < t && t < a && a < b);
                double code(double x, double y, double z, double t, double a, double b) {
                	double t_1 = (y * 9.0) * z;
                	double tmp;
                	if (t_1 <= -4e-42) {
                		tmp = (((-9.0 * z) * y) * t) + ((a * 27.0) * b);
                	} else if (t_1 <= 2e-23) {
                		tmp = fma((27.0 * b), a, x) + x;
                	} else {
                		tmp = fma((27.0 * a), b, (((-9.0 * y) * t) * z));
                	}
                	return tmp;
                }
                
                x, y, z, t, a, b = sort([x, y, z, t, a, b])
                function code(x, y, z, t, a, b)
                	t_1 = Float64(Float64(y * 9.0) * z)
                	tmp = 0.0
                	if (t_1 <= -4e-42)
                		tmp = Float64(Float64(Float64(Float64(-9.0 * z) * y) * t) + Float64(Float64(a * 27.0) * b));
                	elseif (t_1 <= 2e-23)
                		tmp = Float64(fma(Float64(27.0 * b), a, x) + x);
                	else
                		tmp = fma(Float64(27.0 * a), b, Float64(Float64(Float64(-9.0 * y) * t) * z));
                	end
                	return tmp
                end
                
                NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-42], N[(N[(N[(N[(-9.0 * z), $MachinePrecision] * y), $MachinePrecision] * t), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-23], N[(N[(N[(27.0 * b), $MachinePrecision] * a + x), $MachinePrecision] + x), $MachinePrecision], N[(N[(27.0 * a), $MachinePrecision] * b + N[(N[(N[(-9.0 * y), $MachinePrecision] * t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]]
                
                \begin{array}{l}
                [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                \\
                \begin{array}{l}
                t_1 := \left(y \cdot 9\right) \cdot z\\
                \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-42}:\\
                \;\;\;\;\left(\left(-9 \cdot z\right) \cdot y\right) \cdot t + \left(a \cdot 27\right) \cdot b\\
                
                \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-23}:\\
                \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x\right) + x\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(27 \cdot a, b, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < -4.00000000000000015e-42

                  1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

                    if -4.00000000000000015e-42 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 1.99999999999999992e-23

                    1. Initial program 99.8%

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

                      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                    4. Step-by-step derivation
                      1. lower-fma.f64N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                      3. lower-*.f64N/A

                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                      4. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                      5. lower-*.f6489.9

                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                    5. Applied rewrites89.9%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                    6. Step-by-step derivation
                      1. Applied rewrites89.9%

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

                      if 1.99999999999999992e-23 < (*.f64 (*.f64 y #s(literal 9 binary64)) z)

                      1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot 27, b, \left(-9 \cdot \left(z \cdot y\right)\right) \cdot t\right)} \]
                        5. lift-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{a \cdot 27}, b, \left(-9 \cdot \left(z \cdot y\right)\right) \cdot t\right) \]
                        6. *-commutativeN/A

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

                          \[\leadsto \mathsf{fma}\left(\color{blue}{27 \cdot a}, b, \left(-9 \cdot \left(z \cdot y\right)\right) \cdot t\right) \]
                      7. Applied rewrites80.4%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(27 \cdot a, b, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z\right)} \]
                    7. Recombined 3 regimes into one program.
                    8. Add Preprocessing

                    Alternative 8: 83.4% 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 := \left(y \cdot 9\right) \cdot z\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-42}:\\ \;\;\;\;\left(-9 \cdot \left(z \cdot y\right)\right) \cdot t + \left(a \cdot 27\right) \cdot b\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot a, b, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z\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 (* (* y 9.0) z)))
                       (if (<= t_1 -4e-42)
                         (+ (* (* -9.0 (* z y)) t) (* (* a 27.0) b))
                         (if (<= t_1 2e-23)
                           (+ (fma (* 27.0 b) a x) x)
                           (fma (* 27.0 a) b (* (* (* -9.0 y) t) z))))))
                    assert(x < y && y < z && z < t && t < a && a < b);
                    double code(double x, double y, double z, double t, double a, double b) {
                    	double t_1 = (y * 9.0) * z;
                    	double tmp;
                    	if (t_1 <= -4e-42) {
                    		tmp = ((-9.0 * (z * y)) * t) + ((a * 27.0) * b);
                    	} else if (t_1 <= 2e-23) {
                    		tmp = fma((27.0 * b), a, x) + x;
                    	} else {
                    		tmp = fma((27.0 * a), b, (((-9.0 * y) * t) * z));
                    	}
                    	return tmp;
                    }
                    
                    x, y, z, t, a, b = sort([x, y, z, t, a, b])
                    function code(x, y, z, t, a, b)
                    	t_1 = Float64(Float64(y * 9.0) * z)
                    	tmp = 0.0
                    	if (t_1 <= -4e-42)
                    		tmp = Float64(Float64(Float64(-9.0 * Float64(z * y)) * t) + Float64(Float64(a * 27.0) * b));
                    	elseif (t_1 <= 2e-23)
                    		tmp = Float64(fma(Float64(27.0 * b), a, x) + x);
                    	else
                    		tmp = fma(Float64(27.0 * a), b, Float64(Float64(Float64(-9.0 * y) * t) * z));
                    	end
                    	return tmp
                    end
                    
                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-42], N[(N[(N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-23], N[(N[(N[(27.0 * b), $MachinePrecision] * a + x), $MachinePrecision] + x), $MachinePrecision], N[(N[(27.0 * a), $MachinePrecision] * b + N[(N[(N[(-9.0 * y), $MachinePrecision] * t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                    \\
                    \begin{array}{l}
                    t_1 := \left(y \cdot 9\right) \cdot z\\
                    \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-42}:\\
                    \;\;\;\;\left(-9 \cdot \left(z \cdot y\right)\right) \cdot t + \left(a \cdot 27\right) \cdot b\\
                    
                    \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-23}:\\
                    \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x\right) + x\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(27 \cdot a, b, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < -4.00000000000000015e-42

                      1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

                      if -4.00000000000000015e-42 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 1.99999999999999992e-23

                      1. Initial program 99.8%

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

                        \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                      4. Step-by-step derivation
                        1. lower-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                        3. lower-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                        4. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                        5. lower-*.f6489.9

                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                      5. Applied rewrites89.9%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                      6. Step-by-step derivation
                        1. Applied rewrites89.9%

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

                        if 1.99999999999999992e-23 < (*.f64 (*.f64 y #s(literal 9 binary64)) z)

                        1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot 27, b, \left(-9 \cdot \left(z \cdot y\right)\right) \cdot t\right)} \]
                          5. lift-*.f64N/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{a \cdot 27}, b, \left(-9 \cdot \left(z \cdot y\right)\right) \cdot t\right) \]
                          6. *-commutativeN/A

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

                            \[\leadsto \mathsf{fma}\left(\color{blue}{27 \cdot a}, b, \left(-9 \cdot \left(z \cdot y\right)\right) \cdot t\right) \]
                        7. Applied rewrites80.4%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(27 \cdot a, b, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z\right)} \]
                      7. Recombined 3 regimes into one program.
                      8. Add Preprocessing

                      Alternative 9: 83.4% 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 := \left(y \cdot 9\right) \cdot z\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-42}:\\ \;\;\;\;\mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \left(b \cdot a\right) \cdot 27\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot a, b, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z\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 (* (* y 9.0) z)))
                         (if (<= t_1 -4e-42)
                           (fma -9.0 (* (* z y) t) (* (* b a) 27.0))
                           (if (<= t_1 2e-23)
                             (+ (fma (* 27.0 b) a x) x)
                             (fma (* 27.0 a) b (* (* (* -9.0 y) t) z))))))
                      assert(x < y && y < z && z < t && t < a && a < b);
                      double code(double x, double y, double z, double t, double a, double b) {
                      	double t_1 = (y * 9.0) * z;
                      	double tmp;
                      	if (t_1 <= -4e-42) {
                      		tmp = fma(-9.0, ((z * y) * t), ((b * a) * 27.0));
                      	} else if (t_1 <= 2e-23) {
                      		tmp = fma((27.0 * b), a, x) + x;
                      	} else {
                      		tmp = fma((27.0 * a), b, (((-9.0 * y) * t) * z));
                      	}
                      	return tmp;
                      }
                      
                      x, y, z, t, a, b = sort([x, y, z, t, a, b])
                      function code(x, y, z, t, a, b)
                      	t_1 = Float64(Float64(y * 9.0) * z)
                      	tmp = 0.0
                      	if (t_1 <= -4e-42)
                      		tmp = fma(-9.0, Float64(Float64(z * y) * t), Float64(Float64(b * a) * 27.0));
                      	elseif (t_1 <= 2e-23)
                      		tmp = Float64(fma(Float64(27.0 * b), a, x) + x);
                      	else
                      		tmp = fma(Float64(27.0 * a), b, Float64(Float64(Float64(-9.0 * y) * t) * z));
                      	end
                      	return tmp
                      end
                      
                      NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-42], N[(-9.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-23], N[(N[(N[(27.0 * b), $MachinePrecision] * a + x), $MachinePrecision] + x), $MachinePrecision], N[(N[(27.0 * a), $MachinePrecision] * b + N[(N[(N[(-9.0 * y), $MachinePrecision] * t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]]
                      
                      \begin{array}{l}
                      [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                      \\
                      \begin{array}{l}
                      t_1 := \left(y \cdot 9\right) \cdot z\\
                      \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-42}:\\
                      \;\;\;\;\mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \left(b \cdot a\right) \cdot 27\right)\\
                      
                      \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-23}:\\
                      \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x\right) + x\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(27 \cdot a, b, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < -4.00000000000000015e-42

                        1. Initial program 97.2%

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

                          \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                        4. Step-by-step derivation
                          1. fp-cancel-sub-sign-invN/A

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

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

                            \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right) + 27 \cdot \left(a \cdot b\right)} \]
                          4. lower-fma.f64N/A

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

                            \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, 27 \cdot \left(a \cdot b\right)\right) \]
                          6. lower-*.f64N/A

                            \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, 27 \cdot \left(a \cdot b\right)\right) \]
                          7. *-commutativeN/A

                            \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(z \cdot y\right)} \cdot t, 27 \cdot \left(a \cdot b\right)\right) \]
                          8. lower-*.f64N/A

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

                            \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                          10. lower-*.f64N/A

                            \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                          11. *-commutativeN/A

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

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

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

                        if -4.00000000000000015e-42 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 1.99999999999999992e-23

                        1. Initial program 99.8%

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

                          \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                        4. Step-by-step derivation
                          1. lower-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                          2. *-commutativeN/A

                            \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                          3. lower-*.f64N/A

                            \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                          4. *-commutativeN/A

                            \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                          5. lower-*.f6489.9

                            \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                        5. Applied rewrites89.9%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                        6. Step-by-step derivation
                          1. Applied rewrites89.9%

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

                          if 1.99999999999999992e-23 < (*.f64 (*.f64 y #s(literal 9 binary64)) z)

                          1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot 27, b, \left(-9 \cdot \left(z \cdot y\right)\right) \cdot t\right)} \]
                            5. lift-*.f64N/A

                              \[\leadsto \mathsf{fma}\left(\color{blue}{a \cdot 27}, b, \left(-9 \cdot \left(z \cdot y\right)\right) \cdot t\right) \]
                            6. *-commutativeN/A

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

                              \[\leadsto \mathsf{fma}\left(\color{blue}{27 \cdot a}, b, \left(-9 \cdot \left(z \cdot y\right)\right) \cdot t\right) \]
                          7. Applied rewrites80.4%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(27 \cdot a, b, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z\right)} \]
                        7. Recombined 3 regimes into one program.
                        8. Add Preprocessing

                        Alternative 10: 82.9% 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 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+145} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+123}\right):\\ \;\;\;\;\left(\left(z \cdot y\right) \cdot t\right) \cdot -9\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot a, b, x + x\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 (* (* (* y 9.0) z) t)))
                           (if (or (<= t_1 -5e+145) (not (<= t_1 4e+123)))
                             (* (* (* z y) t) -9.0)
                             (fma (* 27.0 a) b (+ x x)))))
                        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 = ((y * 9.0) * z) * t;
                        	double tmp;
                        	if ((t_1 <= -5e+145) || !(t_1 <= 4e+123)) {
                        		tmp = ((z * y) * t) * -9.0;
                        	} else {
                        		tmp = fma((27.0 * a), b, (x + x));
                        	}
                        	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(Float64(Float64(y * 9.0) * z) * t)
                        	tmp = 0.0
                        	if ((t_1 <= -5e+145) || !(t_1 <= 4e+123))
                        		tmp = Float64(Float64(Float64(z * y) * t) * -9.0);
                        	else
                        		tmp = fma(Float64(27.0 * a), b, Float64(x + x));
                        	end
                        	return tmp
                        end
                        
                        NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                        code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+145], N[Not[LessEqual[t$95$1, 4e+123]], $MachinePrecision]], N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * -9.0), $MachinePrecision], N[(N[(27.0 * a), $MachinePrecision] * b + N[(x + x), $MachinePrecision]), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                        \\
                        \begin{array}{l}
                        t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
                        \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+145} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+123}\right):\\
                        \;\;\;\;\left(\left(z \cdot y\right) \cdot t\right) \cdot -9\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\mathsf{fma}\left(27 \cdot a, b, x + x\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.99999999999999967e145 or 3.99999999999999991e123 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                          1. Initial program 93.7%

                            \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                          2. Add Preprocessing
                          3. Step-by-step derivation
                            1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(t \cdot y, -9 \cdot z, \mathsf{fma}\left(b \cdot 27, a, \color{blue}{2 \cdot x}\right)\right) \]
                            2. count-2-revN/A

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

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

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

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

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

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

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

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

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

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

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

                          if -4.99999999999999967e145 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 3.99999999999999991e123

                          1. Initial program 99.7%

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

                            \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                          4. Step-by-step derivation
                            1. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                            2. *-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                            3. lower-*.f64N/A

                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                            4. *-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                            5. lower-*.f6485.6

                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                          5. Applied rewrites85.6%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                          6. Step-by-step derivation
                            1. Applied rewrites85.6%

                              \[\leadsto \mathsf{fma}\left(27 \cdot a, \color{blue}{b}, 2 \cdot x\right) \]
                            2. Step-by-step derivation
                              1. Applied rewrites85.6%

                                \[\leadsto \mathsf{fma}\left(27 \cdot a, b, x + x\right) \]
                            3. Recombined 2 regimes into one program.
                            4. Final simplification84.9%

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

                            Alternative 11: 92.9% accurate, 1.2× speedup?

                            \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \mathsf{fma}\left(t \cdot y, -9 \cdot z, \mathsf{fma}\left(a \cdot 27, b, x\right) + x\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
                             (fma (* t y) (* -9.0 z) (+ (fma (* a 27.0) b x) x)))
                            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 fma((t * y), (-9.0 * z), (fma((a * 27.0), b, x) + x));
                            }
                            
                            x, y, z, t, a, b = sort([x, y, z, t, a, b])
                            function code(x, y, z, t, a, b)
                            	return fma(Float64(t * y), Float64(-9.0 * z), Float64(fma(Float64(a * 27.0), b, x) + x))
                            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[(t * y), $MachinePrecision] * N[(-9.0 * z), $MachinePrecision] + N[(N[(N[(a * 27.0), $MachinePrecision] * b + x), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]
                            
                            \begin{array}{l}
                            [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                            \\
                            \mathsf{fma}\left(t \cdot y, -9 \cdot z, \mathsf{fma}\left(a \cdot 27, b, x\right) + x\right)
                            \end{array}
                            
                            Derivation
                            1. Initial program 97.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. Step-by-step derivation
                              1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(t \cdot y, -9 \cdot z, \mathsf{fma}\left(b \cdot 27, a, \color{blue}{2 \cdot x}\right)\right) \]
                              2. count-2-revN/A

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

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

                              \[\leadsto \mathsf{fma}\left(t \cdot y, -9 \cdot z, \mathsf{fma}\left(b \cdot 27, a, \color{blue}{x + x}\right)\right) \]
                            7. Step-by-step derivation
                              1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 12: 47.6% accurate, 1.6× speedup?

                            \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{+26} \lor \neg \left(x \leq 1.9 \cdot 10^{+76}\right):\\ \;\;\;\;2 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot 27\right) \cdot b\\ \end{array} \end{array} \]
                            NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                            (FPCore (x y z t a b)
                             :precision binary64
                             (if (or (<= x -7.2e+26) (not (<= x 1.9e+76))) (* 2.0 x) (* (* a 27.0) 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 ((x <= -7.2e+26) || !(x <= 1.9e+76)) {
                            		tmp = 2.0 * x;
                            	} else {
                            		tmp = (a * 27.0) * 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 ((x <= (-7.2d+26)) .or. (.not. (x <= 1.9d+76))) then
                                    tmp = 2.0d0 * x
                                else
                                    tmp = (a * 27.0d0) * 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 ((x <= -7.2e+26) || !(x <= 1.9e+76)) {
                            		tmp = 2.0 * x;
                            	} else {
                            		tmp = (a * 27.0) * 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 (x <= -7.2e+26) or not (x <= 1.9e+76):
                            		tmp = 2.0 * x
                            	else:
                            		tmp = (a * 27.0) * 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 ((x <= -7.2e+26) || !(x <= 1.9e+76))
                            		tmp = Float64(2.0 * x);
                            	else
                            		tmp = Float64(Float64(a * 27.0) * 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 ((x <= -7.2e+26) || ~((x <= 1.9e+76)))
                            		tmp = 2.0 * x;
                            	else
                            		tmp = (a * 27.0) * 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[Or[LessEqual[x, -7.2e+26], N[Not[LessEqual[x, 1.9e+76]], $MachinePrecision]], N[(2.0 * x), $MachinePrecision], N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]]
                            
                            \begin{array}{l}
                            [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;x \leq -7.2 \cdot 10^{+26} \lor \neg \left(x \leq 1.9 \cdot 10^{+76}\right):\\
                            \;\;\;\;2 \cdot x\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\left(a \cdot 27\right) \cdot b\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if x < -7.20000000000000048e26 or 1.90000000000000012e76 < x

                              1. Initial program 95.5%

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

                                \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                              4. Step-by-step derivation
                                1. lower-fma.f64N/A

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                2. *-commutativeN/A

                                  \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                3. lower-*.f64N/A

                                  \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                4. *-commutativeN/A

                                  \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                5. lower-*.f6477.5

                                  \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                              5. Applied rewrites77.5%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                              6. Taylor expanded in x around inf

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

                                  \[\leadsto \mathsf{fma}\left(\frac{b \cdot a}{x}, 27, 2\right) \cdot \color{blue}{x} \]
                                2. Taylor expanded in x around inf

                                  \[\leadsto 2 \cdot x \]
                                3. Step-by-step derivation
                                  1. Applied rewrites58.8%

                                    \[\leadsto 2 \cdot x \]

                                  if -7.20000000000000048e26 < x < 1.90000000000000012e76

                                  1. Initial program 99.0%

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

                                    \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                  4. Step-by-step derivation
                                    1. lower-fma.f64N/A

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                    2. *-commutativeN/A

                                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                    3. lower-*.f64N/A

                                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                    4. *-commutativeN/A

                                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                    5. lower-*.f6449.1

                                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                  5. Applied rewrites49.1%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                  6. Taylor expanded in x around 0

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

                                      \[\leadsto \left(b \cdot a\right) \cdot \color{blue}{27} \]
                                    2. Step-by-step derivation
                                      1. Applied rewrites43.0%

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

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{+26} \lor \neg \left(x \leq 1.9 \cdot 10^{+76}\right):\\ \;\;\;\;2 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot 27\right) \cdot b\\ \end{array} \]
                                    5. Add Preprocessing

                                    Alternative 13: 47.6% accurate, 1.6× speedup?

                                    \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{+26} \lor \neg \left(x \leq 1.9 \cdot 10^{+76}\right):\\ \;\;\;\;2 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(27 \cdot b\right) \cdot a\\ \end{array} \end{array} \]
                                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                    (FPCore (x y z t a b)
                                     :precision binary64
                                     (if (or (<= x -7.2e+26) (not (<= x 1.9e+76))) (* 2.0 x) (* (* 27.0 b) a)))
                                    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 ((x <= -7.2e+26) || !(x <= 1.9e+76)) {
                                    		tmp = 2.0 * x;
                                    	} else {
                                    		tmp = (27.0 * b) * a;
                                    	}
                                    	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 ((x <= (-7.2d+26)) .or. (.not. (x <= 1.9d+76))) then
                                            tmp = 2.0d0 * x
                                        else
                                            tmp = (27.0d0 * b) * a
                                        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 ((x <= -7.2e+26) || !(x <= 1.9e+76)) {
                                    		tmp = 2.0 * x;
                                    	} else {
                                    		tmp = (27.0 * b) * a;
                                    	}
                                    	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 (x <= -7.2e+26) or not (x <= 1.9e+76):
                                    		tmp = 2.0 * x
                                    	else:
                                    		tmp = (27.0 * b) * a
                                    	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 ((x <= -7.2e+26) || !(x <= 1.9e+76))
                                    		tmp = Float64(2.0 * x);
                                    	else
                                    		tmp = Float64(Float64(27.0 * b) * a);
                                    	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 ((x <= -7.2e+26) || ~((x <= 1.9e+76)))
                                    		tmp = 2.0 * x;
                                    	else
                                    		tmp = (27.0 * b) * a;
                                    	end
                                    	tmp_2 = tmp;
                                    end
                                    
                                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                    code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -7.2e+26], N[Not[LessEqual[x, 1.9e+76]], $MachinePrecision]], N[(2.0 * x), $MachinePrecision], N[(N[(27.0 * b), $MachinePrecision] * a), $MachinePrecision]]
                                    
                                    \begin{array}{l}
                                    [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;x \leq -7.2 \cdot 10^{+26} \lor \neg \left(x \leq 1.9 \cdot 10^{+76}\right):\\
                                    \;\;\;\;2 \cdot x\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\left(27 \cdot b\right) \cdot a\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if x < -7.20000000000000048e26 or 1.90000000000000012e76 < x

                                      1. Initial program 95.5%

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

                                        \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                      4. Step-by-step derivation
                                        1. lower-fma.f64N/A

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                        2. *-commutativeN/A

                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                        3. lower-*.f64N/A

                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                        4. *-commutativeN/A

                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                        5. lower-*.f6477.5

                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                      5. Applied rewrites77.5%

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                      6. Taylor expanded in x around inf

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

                                          \[\leadsto \mathsf{fma}\left(\frac{b \cdot a}{x}, 27, 2\right) \cdot \color{blue}{x} \]
                                        2. Taylor expanded in x around inf

                                          \[\leadsto 2 \cdot x \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites58.8%

                                            \[\leadsto 2 \cdot x \]

                                          if -7.20000000000000048e26 < x < 1.90000000000000012e76

                                          1. Initial program 99.0%

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

                                            \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                          4. Step-by-step derivation
                                            1. lower-fma.f64N/A

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                            2. *-commutativeN/A

                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                            3. lower-*.f64N/A

                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                            4. *-commutativeN/A

                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                            5. lower-*.f6449.1

                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                          5. Applied rewrites49.1%

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                          6. Taylor expanded in x around 0

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

                                              \[\leadsto \left(b \cdot a\right) \cdot \color{blue}{27} \]
                                            2. Step-by-step derivation
                                              1. Applied rewrites42.4%

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

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{+26} \lor \neg \left(x \leq 1.9 \cdot 10^{+76}\right):\\ \;\;\;\;2 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(27 \cdot b\right) \cdot a\\ \end{array} \]
                                            5. Add Preprocessing

                                            Alternative 14: 63.5% accurate, 2.5× speedup?

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

                                              \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                            4. Step-by-step derivation
                                              1. lower-fma.f64N/A

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                              2. *-commutativeN/A

                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                              3. lower-*.f64N/A

                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                              4. *-commutativeN/A

                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                              5. lower-*.f6461.2

                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                            5. Applied rewrites61.2%

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites61.2%

                                                \[\leadsto \mathsf{fma}\left(27 \cdot a, \color{blue}{b}, 2 \cdot x\right) \]
                                              2. Step-by-step derivation
                                                1. Applied rewrites61.2%

                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, x + x\right) \]
                                                2. Add Preprocessing

                                                Alternative 15: 63.5% accurate, 2.5× speedup?

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

                                                  \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                4. Step-by-step derivation
                                                  1. lower-fma.f64N/A

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                  2. *-commutativeN/A

                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                  3. lower-*.f64N/A

                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                  5. lower-*.f6461.2

                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                5. Applied rewrites61.2%

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites60.9%

                                                    \[\leadsto \mathsf{fma}\left(27 \cdot b, a, x\right) + \color{blue}{x} \]
                                                  2. Add Preprocessing

                                                  Alternative 16: 30.3% accurate, 6.2× speedup?

                                                  \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ 2 \cdot x \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 (* 2.0 x))
                                                  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 2.0 * x;
                                                  }
                                                  
                                                  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 = 2.0d0 * x
                                                  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 2.0 * x;
                                                  }
                                                  
                                                  [x, y, z, t, a, b] = sort([x, y, z, t, a, b])
                                                  def code(x, y, z, t, a, b):
                                                  	return 2.0 * x
                                                  
                                                  x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                  function code(x, y, z, t, a, b)
                                                  	return Float64(2.0 * x)
                                                  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 = 2.0 * x;
                                                  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[(2.0 * x), $MachinePrecision]
                                                  
                                                  \begin{array}{l}
                                                  [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                  \\
                                                  2 \cdot x
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Initial program 97.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 y around 0

                                                    \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                  4. Step-by-step derivation
                                                    1. lower-fma.f64N/A

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                    2. *-commutativeN/A

                                                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                    3. lower-*.f64N/A

                                                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                    4. *-commutativeN/A

                                                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                    5. lower-*.f6461.2

                                                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                  5. Applied rewrites61.2%

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                  6. Taylor expanded in x around inf

                                                    \[\leadsto x \cdot \color{blue}{\left(2 + 27 \cdot \frac{a \cdot b}{x}\right)} \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites58.8%

                                                      \[\leadsto \mathsf{fma}\left(\frac{b \cdot a}{x}, 27, 2\right) \cdot \color{blue}{x} \]
                                                    2. Taylor expanded in x around inf

                                                      \[\leadsto 2 \cdot x \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites29.6%

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

                                                      Developer Target 1: 95.3% accurate, 0.9× speedup?

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

                                                      Reproduce

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