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

Percentage Accurate: 85.4% → 90.1%
Time: 27.7s
Alternatives: 22
Speedup: 0.9×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (-
  (-
   (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
   (* (* x 4.0) i))
  (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k):
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k))
end
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\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 22 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: 85.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (-
  (-
   (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
   (* (* x 4.0) i))
  (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k):
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k))
end
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}

Alternative 1: 90.1% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+146}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{+211}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot \left(x \cdot \left(y \cdot 18\right)\right), z, \mathsf{fma}\left(t, -4 \cdot a, \mathsf{fma}\left(b, c, x \cdot \left(-4 \cdot i\right)\right)\right)\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= x -5e+146)
   (fma x (fma -4.0 i (* t (* (* y z) 18.0))) (fma b c (* j (* k -27.0))))
   (if (<= x 1.9e+211)
     (-
      (fma
       (* t (* x (* y 18.0)))
       z
       (fma t (* -4.0 a) (fma b c (* x (* -4.0 i)))))
      (* k (* j 27.0)))
     (fma b c (* x (fma -4.0 i (* y (* z (* t 18.0)))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if (x <= -5e+146) {
		tmp = fma(x, fma(-4.0, i, (t * ((y * z) * 18.0))), fma(b, c, (j * (k * -27.0))));
	} else if (x <= 1.9e+211) {
		tmp = fma((t * (x * (y * 18.0))), z, fma(t, (-4.0 * a), fma(b, c, (x * (-4.0 * i))))) - (k * (j * 27.0));
	} else {
		tmp = fma(b, c, (x * fma(-4.0, i, (y * (z * (t * 18.0))))));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (x <= -5e+146)
		tmp = fma(x, fma(-4.0, i, Float64(t * Float64(Float64(y * z) * 18.0))), fma(b, c, Float64(j * Float64(k * -27.0))));
	elseif (x <= 1.9e+211)
		tmp = Float64(fma(Float64(t * Float64(x * Float64(y * 18.0))), z, fma(t, Float64(-4.0 * a), fma(b, c, Float64(x * Float64(-4.0 * i))))) - Float64(k * Float64(j * 27.0)));
	else
		tmp = fma(b, c, Float64(x * fma(-4.0, i, Float64(y * Float64(z * Float64(t * 18.0))))));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -5e+146], N[(x * N[(-4.0 * i + N[(t * N[(N[(y * z), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.9e+211], N[(N[(N[(t * N[(x * N[(y * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z + N[(t * N[(-4.0 * a), $MachinePrecision] + N[(b * c + N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * c + N[(x * N[(-4.0 * i + N[(y * N[(z * N[(t * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+146}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)\\

\mathbf{elif}\;x \leq 1.9 \cdot 10^{+211}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot \left(x \cdot \left(y \cdot 18\right)\right), z, \mathsf{fma}\left(t, -4 \cdot a, \mathsf{fma}\left(b, c, x \cdot \left(-4 \cdot i\right)\right)\right)\right) - k \cdot \left(j \cdot 27\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.9999999999999999e146

    1. Initial program 76.8%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites97.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]

    if -4.9999999999999999e146 < x < 1.90000000000000008e211

    1. Initial program 92.1%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Applied rewrites93.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]

    if 1.90000000000000008e211 < x

    1. Initial program 71.8%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Applied rewrites71.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    4. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right) + \left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} \]
    5. Applied rewrites75.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(18 \cdot \left(z \cdot \left(x \cdot t\right)\right), y, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{x \cdot \left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \color{blue}{\mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(18 \cdot t\right) \cdot \left(y \cdot z\right)}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(18 \cdot t\right) \cdot \color{blue}{\left(z \cdot y\right)}\right)\right) \]
      5. associate-*r*N/A

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

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(\left(18 \cdot t\right) \cdot z\right) \cdot y}\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(\left(18 \cdot t\right) \cdot z\right)} \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(\color{blue}{\left(t \cdot 18\right)} \cdot z\right) \cdot y\right)\right) \]
      9. lower-*.f6493.8

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(\color{blue}{\left(t \cdot 18\right)} \cdot z\right) \cdot y\right)\right) \]
    8. Applied rewrites93.8%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{x \cdot \mathsf{fma}\left(-4, i, \left(\left(t \cdot 18\right) \cdot z\right) \cdot y\right)}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification94.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+146}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{+211}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot \left(x \cdot \left(y \cdot 18\right)\right), z, \mathsf{fma}\left(t, -4 \cdot a, \mathsf{fma}\left(b, c, x \cdot \left(-4 \cdot i\right)\right)\right)\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 84.0% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\ t_2 := i \cdot \left(x \cdot 4\right)\\ t_3 := \left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - t\_2\\ \mathbf{if}\;t\_3 \leq -5 \cdot 10^{+283}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+299}:\\ \;\;\;\;\left(\mathsf{fma}\left(-4, t \cdot a, b \cdot c\right) - t\_2\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma b c (* x (fma -4.0 i (* y (* z (* t 18.0)))))))
        (t_2 (* i (* x 4.0)))
        (t_3
         (- (+ (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))) (* b c)) t_2)))
   (if (<= t_3 -5e+283)
     t_1
     (if (<= t_3 2e+299)
       (- (- (fma -4.0 (* t a) (* b c)) t_2) (* k (* j 27.0)))
       t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = fma(b, c, (x * fma(-4.0, i, (y * (z * (t * 18.0))))));
	double t_2 = i * (x * 4.0);
	double t_3 = (((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (b * c)) - t_2;
	double tmp;
	if (t_3 <= -5e+283) {
		tmp = t_1;
	} else if (t_3 <= 2e+299) {
		tmp = (fma(-4.0, (t * a), (b * c)) - t_2) - (k * (j * 27.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(b, c, Float64(x * fma(-4.0, i, Float64(y * Float64(z * Float64(t * 18.0))))))
	t_2 = Float64(i * Float64(x * 4.0))
	t_3 = Float64(Float64(Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - t_2)
	tmp = 0.0
	if (t_3 <= -5e+283)
		tmp = t_1;
	elseif (t_3 <= 2e+299)
		tmp = Float64(Float64(fma(-4.0, Float64(t * a), Float64(b * c)) - t_2) - Float64(k * Float64(j * 27.0)));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(b * c + N[(x * N[(-4.0 * i + N[(y * N[(z * N[(t * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+283], t$95$1, If[LessEqual[t$95$3, 2e+299], N[(N[(N[(-4.0 * N[(t * a), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\
t_2 := i \cdot \left(x \cdot 4\right)\\
t_3 := \left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - t\_2\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{+283}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;\left(\mathsf{fma}\left(-4, t \cdot a, b \cdot c\right) - t\_2\right) - k \cdot \left(j \cdot 27\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < -5.0000000000000004e283 or 2.0000000000000001e299 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i))

    1. Initial program 75.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Applied rewrites82.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    4. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right) + \left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} \]
    5. Applied rewrites82.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(18 \cdot \left(z \cdot \left(x \cdot t\right)\right), y, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{x \cdot \left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \color{blue}{\mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(18 \cdot t\right) \cdot \left(y \cdot z\right)}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(18 \cdot t\right) \cdot \color{blue}{\left(z \cdot y\right)}\right)\right) \]
      5. associate-*r*N/A

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

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(\left(18 \cdot t\right) \cdot z\right) \cdot y}\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(\left(18 \cdot t\right) \cdot z\right)} \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(\color{blue}{\left(t \cdot 18\right)} \cdot z\right) \cdot y\right)\right) \]
      9. lower-*.f6486.1

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(\color{blue}{\left(t \cdot 18\right)} \cdot z\right) \cdot y\right)\right) \]
    8. Applied rewrites86.1%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{x \cdot \mathsf{fma}\left(-4, i, \left(\left(t \cdot 18\right) \cdot z\right) \cdot y\right)}\right) \]

    if -5.0000000000000004e283 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < 2.0000000000000001e299

    1. Initial program 99.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \left(\color{blue}{\left(b \cdot c - 4 \cdot \left(a \cdot t\right)\right)} - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \left(\color{blue}{\left(b \cdot c + \left(\mathsf{neg}\left(4 \cdot \left(a \cdot t\right)\right)\right)\right)} - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      2. +-commutativeN/A

        \[\leadsto \left(\color{blue}{\left(\left(\mathsf{neg}\left(4 \cdot \left(a \cdot t\right)\right)\right) + b \cdot c\right)} - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \left(\left(\color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t\right)} + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      4. metadata-evalN/A

        \[\leadsto \left(\left(\color{blue}{-4} \cdot \left(a \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      5. lower-fma.f64N/A

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(-4, a \cdot t, b \cdot c\right)} - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      6. lower-*.f64N/A

        \[\leadsto \left(\mathsf{fma}\left(-4, \color{blue}{a \cdot t}, b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      7. lower-*.f6494.4

        \[\leadsto \left(\mathsf{fma}\left(-4, a \cdot t, \color{blue}{b \cdot c}\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites94.4%

      \[\leadsto \left(\color{blue}{\mathsf{fma}\left(-4, a \cdot t, b \cdot c\right)} - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right) \leq -5 \cdot 10^{+283}:\\ \;\;\;\;\mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\ \mathbf{elif}\;\left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right) \leq 2 \cdot 10^{+299}:\\ \;\;\;\;\left(\mathsf{fma}\left(-4, t \cdot a, b \cdot c\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 84.0% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\ t_2 := \left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right)\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+283}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+299}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma b c (* x (fma -4.0 i (* y (* z (* t 18.0)))))))
        (t_2
         (-
          (+ (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))) (* b c))
          (* i (* x 4.0)))))
   (if (<= t_2 -5e+283)
     t_1
     (if (<= t_2 2e+299)
       (fma b c (fma -4.0 (fma a t (* x i)) (* j (* k -27.0))))
       t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = fma(b, c, (x * fma(-4.0, i, (y * (z * (t * 18.0))))));
	double t_2 = (((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (b * c)) - (i * (x * 4.0));
	double tmp;
	if (t_2 <= -5e+283) {
		tmp = t_1;
	} else if (t_2 <= 2e+299) {
		tmp = fma(b, c, fma(-4.0, fma(a, t, (x * i)), (j * (k * -27.0))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(b, c, Float64(x * fma(-4.0, i, Float64(y * Float64(z * Float64(t * 18.0))))))
	t_2 = Float64(Float64(Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(i * Float64(x * 4.0)))
	tmp = 0.0
	if (t_2 <= -5e+283)
		tmp = t_1;
	elseif (t_2 <= 2e+299)
		tmp = fma(b, c, fma(-4.0, fma(a, t, Float64(x * i)), Float64(j * Float64(k * -27.0))));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(b * c + N[(x * N[(-4.0 * i + N[(y * N[(z * N[(t * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+283], t$95$1, If[LessEqual[t$95$2, 2e+299], N[(b * c + N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\
t_2 := \left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+283}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < -5.0000000000000004e283 or 2.0000000000000001e299 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i))

    1. Initial program 75.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Applied rewrites82.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    4. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right) + \left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} \]
    5. Applied rewrites82.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(18 \cdot \left(z \cdot \left(x \cdot t\right)\right), y, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{x \cdot \left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \color{blue}{\mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(18 \cdot t\right) \cdot \left(y \cdot z\right)}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(18 \cdot t\right) \cdot \color{blue}{\left(z \cdot y\right)}\right)\right) \]
      5. associate-*r*N/A

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

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(\left(18 \cdot t\right) \cdot z\right) \cdot y}\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(\left(18 \cdot t\right) \cdot z\right)} \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(\color{blue}{\left(t \cdot 18\right)} \cdot z\right) \cdot y\right)\right) \]
      9. lower-*.f6486.1

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(\color{blue}{\left(t \cdot 18\right)} \cdot z\right) \cdot y\right)\right) \]
    8. Applied rewrites86.1%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{x \cdot \mathsf{fma}\left(-4, i, \left(\left(t \cdot 18\right) \cdot z\right) \cdot y\right)}\right) \]

    if -5.0000000000000004e283 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < 2.0000000000000001e299

    1. Initial program 99.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6494.4

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites94.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right) \leq -5 \cdot 10^{+283}:\\ \;\;\;\;\mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\ \mathbf{elif}\;\left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right) \leq 2 \cdot 10^{+299}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.6% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\ t_2 := \left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right)\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+280}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+299}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma b c (* x (fma -4.0 i (* y (* z (* t 18.0)))))))
        (t_2
         (-
          (+ (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))) (* b c))
          (* i (* x 4.0)))))
   (if (<= t_2 -1e+280)
     t_1
     (if (<= t_2 2e+299) (fma b c (fma -4.0 (* t a) (* j (* k -27.0)))) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = fma(b, c, (x * fma(-4.0, i, (y * (z * (t * 18.0))))));
	double t_2 = (((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (b * c)) - (i * (x * 4.0));
	double tmp;
	if (t_2 <= -1e+280) {
		tmp = t_1;
	} else if (t_2 <= 2e+299) {
		tmp = fma(b, c, fma(-4.0, (t * a), (j * (k * -27.0))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(b, c, Float64(x * fma(-4.0, i, Float64(y * Float64(z * Float64(t * 18.0))))))
	t_2 = Float64(Float64(Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(i * Float64(x * 4.0)))
	tmp = 0.0
	if (t_2 <= -1e+280)
		tmp = t_1;
	elseif (t_2 <= 2e+299)
		tmp = fma(b, c, fma(-4.0, Float64(t * a), Float64(j * Float64(k * -27.0))));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(b * c + N[(x * N[(-4.0 * i + N[(y * N[(z * N[(t * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+280], t$95$1, If[LessEqual[t$95$2, 2e+299], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\
t_2 := \left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+280}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < -1e280 or 2.0000000000000001e299 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i))

    1. Initial program 76.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Applied rewrites83.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    4. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right) + \left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} \]
    5. Applied rewrites82.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(18 \cdot \left(z \cdot \left(x \cdot t\right)\right), y, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{x \cdot \left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \color{blue}{\mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(18 \cdot t\right) \cdot \left(y \cdot z\right)}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(18 \cdot t\right) \cdot \color{blue}{\left(z \cdot y\right)}\right)\right) \]
      5. associate-*r*N/A

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

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(\left(18 \cdot t\right) \cdot z\right) \cdot y}\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(\left(18 \cdot t\right) \cdot z\right)} \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(\color{blue}{\left(t \cdot 18\right)} \cdot z\right) \cdot y\right)\right) \]
      9. lower-*.f6486.3

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(\color{blue}{\left(t \cdot 18\right)} \cdot z\right) \cdot y\right)\right) \]
    8. Applied rewrites86.3%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{x \cdot \mathsf{fma}\left(-4, i, \left(\left(t \cdot 18\right) \cdot z\right) \cdot y\right)}\right) \]

    if -1e280 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < 2.0000000000000001e299

    1. Initial program 99.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      3. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \left(a \cdot t\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      8. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{a \cdot t}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      15. lower-*.f6479.5

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites79.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \left(k \cdot -27\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right) \leq -1 \cdot 10^{+280}:\\ \;\;\;\;\mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\ \mathbf{elif}\;\left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right) \leq 2 \cdot 10^{+299}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 92.3% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} \mathbf{if}\;\left(\left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right) \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(x, -4 \cdot i, \mathsf{fma}\left(t, \mathsf{fma}\left(x, \left(y \cdot z\right) \cdot 18, -4 \cdot a\right), b \cdot c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<=
      (-
       (-
        (+ (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))) (* b c))
        (* i (* x 4.0)))
       (* k (* j 27.0)))
      INFINITY)
   (fma
    (* j k)
    -27.0
    (fma x (* -4.0 i) (fma t (fma x (* (* y z) 18.0) (* -4.0 a)) (* b c))))
   (fma b c (* x (fma -4.0 i (* y (* z (* t 18.0))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if ((((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (b * c)) - (i * (x * 4.0))) - (k * (j * 27.0))) <= ((double) INFINITY)) {
		tmp = fma((j * k), -27.0, fma(x, (-4.0 * i), fma(t, fma(x, ((y * z) * 18.0), (-4.0 * a)), (b * c))));
	} else {
		tmp = fma(b, c, (x * fma(-4.0, i, (y * (z * (t * 18.0))))));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (Float64(Float64(Float64(Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(i * Float64(x * 4.0))) - Float64(k * Float64(j * 27.0))) <= Inf)
		tmp = fma(Float64(j * k), -27.0, fma(x, Float64(-4.0 * i), fma(t, fma(x, Float64(Float64(y * z) * 18.0), Float64(-4.0 * a)), Float64(b * c))));
	else
		tmp = fma(b, c, Float64(x * fma(-4.0, i, Float64(y * Float64(z * Float64(t * 18.0))))));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(N[(N[(N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(x * N[(-4.0 * i), $MachinePrecision] + N[(t * N[(x * N[(N[(y * z), $MachinePrecision] * 18.0), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * c + N[(x * N[(-4.0 * i + N[(y * N[(z * N[(t * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(x, -4 \cdot i, \mathsf{fma}\left(t, \mathsf{fma}\left(x, \left(y \cdot z\right) \cdot 18, -4 \cdot a\right), b \cdot c\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0

    1. Initial program 95.1%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Applied rewrites94.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot j, -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), b \cdot c\right)\right)\right)} \]

    if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k))

    1. Initial program 0.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Applied rewrites23.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    4. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right) + \left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} \]
    5. Applied rewrites38.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(18 \cdot \left(z \cdot \left(x \cdot t\right)\right), y, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{x \cdot \left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \color{blue}{\mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(18 \cdot t\right) \cdot \left(y \cdot z\right)}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(18 \cdot t\right) \cdot \color{blue}{\left(z \cdot y\right)}\right)\right) \]
      5. associate-*r*N/A

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

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(\left(18 \cdot t\right) \cdot z\right) \cdot y}\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(\left(18 \cdot t\right) \cdot z\right)} \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(\color{blue}{\left(t \cdot 18\right)} \cdot z\right) \cdot y\right)\right) \]
      9. lower-*.f6471.5

        \[\leadsto \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, \left(\color{blue}{\left(t \cdot 18\right)} \cdot z\right) \cdot y\right)\right) \]
    8. Applied rewrites71.5%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{x \cdot \mathsf{fma}\left(-4, i, \left(\left(t \cdot 18\right) \cdot z\right) \cdot y\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right) \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(x, -4 \cdot i, \mathsf{fma}\left(t, \mathsf{fma}\left(x, \left(y \cdot z\right) \cdot 18, -4 \cdot a\right), b \cdot c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, y \cdot \left(z \cdot \left(t \cdot 18\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 68.9% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+185}:\\ \;\;\;\;\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+58}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* k (* j 27.0))))
   (if (<= t_1 -1e+185)
     (fma (* k -27.0) j (* -4.0 (* t a)))
     (if (<= t_1 2e+58)
       (fma b c (* -4.0 (fma i x (* t a))))
       (if (<= t_1 2e+244)
         (fma j (* k -27.0) (* -4.0 (* x i)))
         (fma (* j -27.0) k (* b c)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = k * (j * 27.0);
	double tmp;
	if (t_1 <= -1e+185) {
		tmp = fma((k * -27.0), j, (-4.0 * (t * a)));
	} else if (t_1 <= 2e+58) {
		tmp = fma(b, c, (-4.0 * fma(i, x, (t * a))));
	} else if (t_1 <= 2e+244) {
		tmp = fma(j, (k * -27.0), (-4.0 * (x * i)));
	} else {
		tmp = fma((j * -27.0), k, (b * c));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(k * Float64(j * 27.0))
	tmp = 0.0
	if (t_1 <= -1e+185)
		tmp = fma(Float64(k * -27.0), j, Float64(-4.0 * Float64(t * a)));
	elseif (t_1 <= 2e+58)
		tmp = fma(b, c, Float64(-4.0 * fma(i, x, Float64(t * a))));
	elseif (t_1 <= 2e+244)
		tmp = fma(j, Float64(k * -27.0), Float64(-4.0 * Float64(x * i)));
	else
		tmp = fma(Float64(j * -27.0), k, Float64(b * c));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+185], N[(N[(k * -27.0), $MachinePrecision] * j + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+58], N[(b * c + N[(-4.0 * N[(i * x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+244], N[(j * N[(k * -27.0), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * -27.0), $MachinePrecision] * k + N[(b * c), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+185}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(t \cdot a\right)\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\
\;\;\;\;\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \left(x \cdot i\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.9999999999999998e184

    1. Initial program 83.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
      2. lower-*.f6473.3

        \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites73.3%

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
      3. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      4. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      5. *-commutativeN/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - \color{blue}{\left(27 \cdot j\right)} \cdot k \]
      6. associate-*l*N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - \color{blue}{27 \cdot \left(j \cdot k\right)} \]
      7. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - 27 \cdot \color{blue}{\left(j \cdot k\right)} \]
      8. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right) + \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)} \]
      9. metadata-evalN/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + \color{blue}{-27} \cdot \left(j \cdot k\right) \]
      10. *-commutativeN/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      11. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(j \cdot k\right)} \cdot -27 \]
      12. associate-*r*N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      13. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      14. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + -4 \cdot \left(a \cdot t\right)} \]
      15. *-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot -27\right) \cdot j} + -4 \cdot \left(a \cdot t\right) \]
      16. lower-fma.f6475.7

        \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(a \cdot t\right)\right)} \]
    7. Applied rewrites75.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(a \cdot t\right)\right)} \]

    if -9.9999999999999998e184 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999989e58

    1. Initial program 88.5%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6481.8

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites81.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in j around 0

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
      4. lower-*.f6479.1

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{a \cdot t}\right)\right) \]
    8. Applied rewrites79.1%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]

    if 1.99999999999999989e58 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000015e244

    1. Initial program 88.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6478.1

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites78.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      4. distribute-lft-inN/A

        \[\leadsto j \cdot \left(-27 \cdot k\right) + \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      8. distribute-lft-inN/A

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

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(i \cdot x + a \cdot t\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
      12. lower-*.f6473.3

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{a \cdot t}\right)\right) \]
    8. Applied rewrites73.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)} \]
    9. Taylor expanded in i around inf

      \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
      2. lower-*.f6464.7

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(i \cdot x\right)}\right) \]
    11. Applied rewrites64.7%

      \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]

    if 2.00000000000000015e244 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6484.2

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites84.2%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} + b \cdot c \]
      14. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + b \cdot c \]
      15. associate-*r*N/A

        \[\leadsto \color{blue}{\left(j \cdot -27\right) \cdot k} + b \cdot c \]
      16. metadata-evalN/A

        \[\leadsto \left(j \cdot \color{blue}{\left(\mathsf{neg}\left(27\right)\right)}\right) \cdot k + b \cdot c \]
      17. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(j \cdot 27\right)\right)} \cdot k + b \cdot c \]
      18. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k + b \cdot c \]
      19. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(j \cdot 27\right), k, b \cdot c\right)} \]
      20. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right), k, b \cdot c\right) \]
      21. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot \left(\mathsf{neg}\left(27\right)\right)}, k, b \cdot c\right) \]
      22. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(j \cdot \color{blue}{-27}, k, b \cdot c\right) \]
      23. lower-*.f6488.2

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot -27}, k, b \cdot c\right) \]
    7. Applied rewrites88.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification77.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -1 \cdot 10^{+185}:\\ \;\;\;\;\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+58}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+244}:\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 55.2% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := -4 \cdot \left(x \cdot i\right)\\ t_2 := k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+165}:\\ \;\;\;\;\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+56}:\\ \;\;\;\;\mathsf{fma}\left(b, c, t\_1\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+244}:\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* -4.0 (* x i))) (t_2 (* k (* j 27.0))))
   (if (<= t_2 -4e+165)
     (fma (* k -27.0) j (* -4.0 (* t a)))
     (if (<= t_2 5e+56)
       (fma b c t_1)
       (if (<= t_2 2e+244)
         (fma j (* k -27.0) t_1)
         (fma (* j -27.0) k (* b c)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = -4.0 * (x * i);
	double t_2 = k * (j * 27.0);
	double tmp;
	if (t_2 <= -4e+165) {
		tmp = fma((k * -27.0), j, (-4.0 * (t * a)));
	} else if (t_2 <= 5e+56) {
		tmp = fma(b, c, t_1);
	} else if (t_2 <= 2e+244) {
		tmp = fma(j, (k * -27.0), t_1);
	} else {
		tmp = fma((j * -27.0), k, (b * c));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(-4.0 * Float64(x * i))
	t_2 = Float64(k * Float64(j * 27.0))
	tmp = 0.0
	if (t_2 <= -4e+165)
		tmp = fma(Float64(k * -27.0), j, Float64(-4.0 * Float64(t * a)));
	elseif (t_2 <= 5e+56)
		tmp = fma(b, c, t_1);
	elseif (t_2 <= 2e+244)
		tmp = fma(j, Float64(k * -27.0), t_1);
	else
		tmp = fma(Float64(j * -27.0), k, Float64(b * c));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+165], N[(N[(k * -27.0), $MachinePrecision] * j + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+56], N[(b * c + t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e+244], N[(j * N[(k * -27.0), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(j * -27.0), $MachinePrecision] * k + N[(b * c), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i\right)\\
t_2 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+165}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(t \cdot a\right)\right)\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(b, c, t\_1\right)\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+244}:\\
\;\;\;\;\mathsf{fma}\left(j, k \cdot -27, t\_1\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -3.9999999999999996e165

    1. Initial program 84.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
      2. lower-*.f6473.9

        \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites73.9%

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
      3. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      4. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      5. *-commutativeN/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - \color{blue}{\left(27 \cdot j\right)} \cdot k \]
      6. associate-*l*N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - \color{blue}{27 \cdot \left(j \cdot k\right)} \]
      7. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - 27 \cdot \color{blue}{\left(j \cdot k\right)} \]
      8. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right) + \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)} \]
      9. metadata-evalN/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + \color{blue}{-27} \cdot \left(j \cdot k\right) \]
      10. *-commutativeN/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      11. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(j \cdot k\right)} \cdot -27 \]
      12. associate-*r*N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      13. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      14. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + -4 \cdot \left(a \cdot t\right)} \]
      15. *-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot -27\right) \cdot j} + -4 \cdot \left(a \cdot t\right) \]
      16. lower-fma.f6476.2

        \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(a \cdot t\right)\right)} \]
    7. Applied rewrites76.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(a \cdot t\right)\right)} \]

    if -3.9999999999999996e165 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.00000000000000024e56

    1. Initial program 88.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6481.6

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites81.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
      2. lower-*.f6458.4

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\left(i \cdot x\right)}\right) \]
    8. Applied rewrites58.4%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]

    if 5.00000000000000024e56 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000015e244

    1. Initial program 88.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6478.7

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites78.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      4. distribute-lft-inN/A

        \[\leadsto j \cdot \left(-27 \cdot k\right) + \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      8. distribute-lft-inN/A

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

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(i \cdot x + a \cdot t\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
      12. lower-*.f6474.1

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{a \cdot t}\right)\right) \]
    8. Applied rewrites74.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)} \]
    9. Taylor expanded in i around inf

      \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
      2. lower-*.f6462.8

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(i \cdot x\right)}\right) \]
    11. Applied rewrites62.8%

      \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]

    if 2.00000000000000015e244 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6484.2

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites84.2%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} + b \cdot c \]
      14. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + b \cdot c \]
      15. associate-*r*N/A

        \[\leadsto \color{blue}{\left(j \cdot -27\right) \cdot k} + b \cdot c \]
      16. metadata-evalN/A

        \[\leadsto \left(j \cdot \color{blue}{\left(\mathsf{neg}\left(27\right)\right)}\right) \cdot k + b \cdot c \]
      17. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(j \cdot 27\right)\right)} \cdot k + b \cdot c \]
      18. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k + b \cdot c \]
      19. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(j \cdot 27\right), k, b \cdot c\right)} \]
      20. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right), k, b \cdot c\right) \]
      21. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot \left(\mathsf{neg}\left(27\right)\right)}, k, b \cdot c\right) \]
      22. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(j \cdot \color{blue}{-27}, k, b \cdot c\right) \]
      23. lower-*.f6488.2

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot -27}, k, b \cdot c\right) \]
    7. Applied rewrites88.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification65.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -4 \cdot 10^{+165}:\\ \;\;\;\;\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 5 \cdot 10^{+56}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+244}:\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 55.2% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := k \cdot \left(j \cdot 27\right)\\ t_2 := -4 \cdot \left(x \cdot i\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+151}:\\ \;\;\;\;\mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+56}:\\ \;\;\;\;\mathsf{fma}\left(b, c, t\_2\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, t\_2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* k (* j 27.0))) (t_2 (* -4.0 (* x i))))
   (if (<= t_1 -5e+151)
     (fma (* k -27.0) j (* b c))
     (if (<= t_1 5e+56)
       (fma b c t_2)
       (if (<= t_1 2e+244)
         (fma j (* k -27.0) t_2)
         (fma (* j -27.0) k (* b c)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = k * (j * 27.0);
	double t_2 = -4.0 * (x * i);
	double tmp;
	if (t_1 <= -5e+151) {
		tmp = fma((k * -27.0), j, (b * c));
	} else if (t_1 <= 5e+56) {
		tmp = fma(b, c, t_2);
	} else if (t_1 <= 2e+244) {
		tmp = fma(j, (k * -27.0), t_2);
	} else {
		tmp = fma((j * -27.0), k, (b * c));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(k * Float64(j * 27.0))
	t_2 = Float64(-4.0 * Float64(x * i))
	tmp = 0.0
	if (t_1 <= -5e+151)
		tmp = fma(Float64(k * -27.0), j, Float64(b * c));
	elseif (t_1 <= 5e+56)
		tmp = fma(b, c, t_2);
	elseif (t_1 <= 2e+244)
		tmp = fma(j, Float64(k * -27.0), t_2);
	else
		tmp = fma(Float64(j * -27.0), k, Float64(b * c));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+151], N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+56], N[(b * c + t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 2e+244], N[(j * N[(k * -27.0), $MachinePrecision] + t$95$2), $MachinePrecision], N[(N[(j * -27.0), $MachinePrecision] * k + N[(b * c), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot 27\right)\\
t_2 := -4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+151}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(b, c, t\_2\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\
\;\;\;\;\mathsf{fma}\left(j, k \cdot -27, t\_2\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5.0000000000000002e151

    1. Initial program 84.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6469.2

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites69.2%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. *-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot -27\right) \cdot j} + b \cdot c \]
      14. lower-fma.f6469.2

        \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)} \]
    7. Applied rewrites69.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)} \]

    if -5.0000000000000002e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.00000000000000024e56

    1. Initial program 88.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6481.9

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites81.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
      2. lower-*.f6458.7

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\left(i \cdot x\right)}\right) \]
    8. Applied rewrites58.7%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]

    if 5.00000000000000024e56 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000015e244

    1. Initial program 88.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6478.7

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites78.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      4. distribute-lft-inN/A

        \[\leadsto j \cdot \left(-27 \cdot k\right) + \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      8. distribute-lft-inN/A

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

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(i \cdot x + a \cdot t\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
      12. lower-*.f6474.1

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{a \cdot t}\right)\right) \]
    8. Applied rewrites74.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)} \]
    9. Taylor expanded in i around inf

      \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
      2. lower-*.f6462.8

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(i \cdot x\right)}\right) \]
    11. Applied rewrites62.8%

      \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]

    if 2.00000000000000015e244 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6484.2

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites84.2%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} + b \cdot c \]
      14. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + b \cdot c \]
      15. associate-*r*N/A

        \[\leadsto \color{blue}{\left(j \cdot -27\right) \cdot k} + b \cdot c \]
      16. metadata-evalN/A

        \[\leadsto \left(j \cdot \color{blue}{\left(\mathsf{neg}\left(27\right)\right)}\right) \cdot k + b \cdot c \]
      17. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(j \cdot 27\right)\right)} \cdot k + b \cdot c \]
      18. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k + b \cdot c \]
      19. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(j \cdot 27\right), k, b \cdot c\right)} \]
      20. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right), k, b \cdot c\right) \]
      21. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot \left(\mathsf{neg}\left(27\right)\right)}, k, b \cdot c\right) \]
      22. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(j \cdot \color{blue}{-27}, k, b \cdot c\right) \]
      23. lower-*.f6488.2

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot -27}, k, b \cdot c\right) \]
    7. Applied rewrites88.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification64.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -5 \cdot 10^{+151}:\\ \;\;\;\;\mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 5 \cdot 10^{+56}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+244}:\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 53.7% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+151}:\\ \;\;\;\;\mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* k (* j 27.0))))
   (if (<= t_1 -5e+151)
     (fma (* k -27.0) j (* b c))
     (if (<= t_1 4e-97)
       (fma b c (* -4.0 (* x i)))
       (if (<= t_1 2e+244)
         (* -4.0 (fma a t (* x i)))
         (fma (* j -27.0) k (* b c)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = k * (j * 27.0);
	double tmp;
	if (t_1 <= -5e+151) {
		tmp = fma((k * -27.0), j, (b * c));
	} else if (t_1 <= 4e-97) {
		tmp = fma(b, c, (-4.0 * (x * i)));
	} else if (t_1 <= 2e+244) {
		tmp = -4.0 * fma(a, t, (x * i));
	} else {
		tmp = fma((j * -27.0), k, (b * c));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(k * Float64(j * 27.0))
	tmp = 0.0
	if (t_1 <= -5e+151)
		tmp = fma(Float64(k * -27.0), j, Float64(b * c));
	elseif (t_1 <= 4e-97)
		tmp = fma(b, c, Float64(-4.0 * Float64(x * i)));
	elseif (t_1 <= 2e+244)
		tmp = Float64(-4.0 * fma(a, t, Float64(x * i)));
	else
		tmp = fma(Float64(j * -27.0), k, Float64(b * c));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+151], N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e-97], N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+244], N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * -27.0), $MachinePrecision] * k + N[(b * c), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+151}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-97}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\
\;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5.0000000000000002e151

    1. Initial program 84.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6469.2

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites69.2%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. *-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot -27\right) \cdot j} + b \cdot c \]
      14. lower-fma.f6469.2

        \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)} \]
    7. Applied rewrites69.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)} \]

    if -5.0000000000000002e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.00000000000000014e-97

    1. Initial program 88.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6481.1

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites81.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
      2. lower-*.f6458.5

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\left(i \cdot x\right)}\right) \]
    8. Applied rewrites58.5%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]

    if 4.00000000000000014e-97 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000015e244

    1. Initial program 88.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6482.1

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites82.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      4. distribute-lft-inN/A

        \[\leadsto j \cdot \left(-27 \cdot k\right) + \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      8. distribute-lft-inN/A

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

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(i \cdot x + a \cdot t\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
      12. lower-*.f6475.3

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{a \cdot t}\right)\right) \]
    8. Applied rewrites75.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)} \]
    9. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -4 \cdot \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)} \]
      3. lower-*.f6458.2

        \[\leadsto -4 \cdot \mathsf{fma}\left(a, t, \color{blue}{i \cdot x}\right) \]
    11. Applied rewrites58.2%

      \[\leadsto \color{blue}{-4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)} \]

    if 2.00000000000000015e244 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6484.2

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites84.2%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} + b \cdot c \]
      14. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + b \cdot c \]
      15. associate-*r*N/A

        \[\leadsto \color{blue}{\left(j \cdot -27\right) \cdot k} + b \cdot c \]
      16. metadata-evalN/A

        \[\leadsto \left(j \cdot \color{blue}{\left(\mathsf{neg}\left(27\right)\right)}\right) \cdot k + b \cdot c \]
      17. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(j \cdot 27\right)\right)} \cdot k + b \cdot c \]
      18. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k + b \cdot c \]
      19. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(j \cdot 27\right), k, b \cdot c\right)} \]
      20. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right), k, b \cdot c\right) \]
      21. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot \left(\mathsf{neg}\left(27\right)\right)}, k, b \cdot c\right) \]
      22. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(j \cdot \color{blue}{-27}, k, b \cdot c\right) \]
      23. lower-*.f6488.2

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot -27}, k, b \cdot c\right) \]
    7. Applied rewrites88.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification63.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -5 \cdot 10^{+151}:\\ \;\;\;\;\mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 4 \cdot 10^{-97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 53.7% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+151}:\\ \;\;\;\;\mathsf{fma}\left(c, b, k \cdot \left(j \cdot -27\right)\right)\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* k (* j 27.0))))
   (if (<= t_1 -5e+151)
     (fma c b (* k (* j -27.0)))
     (if (<= t_1 4e-97)
       (fma b c (* -4.0 (* x i)))
       (if (<= t_1 2e+244)
         (* -4.0 (fma a t (* x i)))
         (fma (* j -27.0) k (* b c)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = k * (j * 27.0);
	double tmp;
	if (t_1 <= -5e+151) {
		tmp = fma(c, b, (k * (j * -27.0)));
	} else if (t_1 <= 4e-97) {
		tmp = fma(b, c, (-4.0 * (x * i)));
	} else if (t_1 <= 2e+244) {
		tmp = -4.0 * fma(a, t, (x * i));
	} else {
		tmp = fma((j * -27.0), k, (b * c));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(k * Float64(j * 27.0))
	tmp = 0.0
	if (t_1 <= -5e+151)
		tmp = fma(c, b, Float64(k * Float64(j * -27.0)));
	elseif (t_1 <= 4e-97)
		tmp = fma(b, c, Float64(-4.0 * Float64(x * i)));
	elseif (t_1 <= 2e+244)
		tmp = Float64(-4.0 * fma(a, t, Float64(x * i)));
	else
		tmp = fma(Float64(j * -27.0), k, Float64(b * c));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+151], N[(c * b + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e-97], N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+244], N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * -27.0), $MachinePrecision] * k + N[(b * c), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+151}:\\
\;\;\;\;\mathsf{fma}\left(c, b, k \cdot \left(j \cdot -27\right)\right)\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-97}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\
\;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5.0000000000000002e151

    1. Initial program 84.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6469.2

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites69.2%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} + j \cdot \left(k \cdot -27\right) \]
      12. *-commutativeN/A

        \[\leadsto \color{blue}{c \cdot b} + j \cdot \left(k \cdot -27\right) \]
      13. lower-fma.f6469.1

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, j \cdot \left(k \cdot -27\right)\right)} \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      16. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(j \cdot k\right) \cdot -27}\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      19. lower-*.f6469.2

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
    7. Applied rewrites69.2%

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

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

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(-27 \cdot j\right) \cdot k}\right) \]
      3. lower-*.f6469.2

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(-27 \cdot j\right)} \cdot k\right) \]
    9. Applied rewrites69.2%

      \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(-27 \cdot j\right) \cdot k}\right) \]

    if -5.0000000000000002e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.00000000000000014e-97

    1. Initial program 88.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6481.1

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites81.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
      2. lower-*.f6458.5

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\left(i \cdot x\right)}\right) \]
    8. Applied rewrites58.5%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]

    if 4.00000000000000014e-97 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000015e244

    1. Initial program 88.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6482.1

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites82.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      4. distribute-lft-inN/A

        \[\leadsto j \cdot \left(-27 \cdot k\right) + \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      8. distribute-lft-inN/A

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

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(i \cdot x + a \cdot t\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
      12. lower-*.f6475.3

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{a \cdot t}\right)\right) \]
    8. Applied rewrites75.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)} \]
    9. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -4 \cdot \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)} \]
      3. lower-*.f6458.2

        \[\leadsto -4 \cdot \mathsf{fma}\left(a, t, \color{blue}{i \cdot x}\right) \]
    11. Applied rewrites58.2%

      \[\leadsto \color{blue}{-4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)} \]

    if 2.00000000000000015e244 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6484.2

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites84.2%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} + b \cdot c \]
      14. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + b \cdot c \]
      15. associate-*r*N/A

        \[\leadsto \color{blue}{\left(j \cdot -27\right) \cdot k} + b \cdot c \]
      16. metadata-evalN/A

        \[\leadsto \left(j \cdot \color{blue}{\left(\mathsf{neg}\left(27\right)\right)}\right) \cdot k + b \cdot c \]
      17. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(j \cdot 27\right)\right)} \cdot k + b \cdot c \]
      18. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k + b \cdot c \]
      19. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(j \cdot 27\right), k, b \cdot c\right)} \]
      20. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right), k, b \cdot c\right) \]
      21. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot \left(\mathsf{neg}\left(27\right)\right)}, k, b \cdot c\right) \]
      22. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(j \cdot \color{blue}{-27}, k, b \cdot c\right) \]
      23. lower-*.f6488.2

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot -27}, k, b \cdot c\right) \]
    7. Applied rewrites88.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification63.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -5 \cdot 10^{+151}:\\ \;\;\;\;\mathsf{fma}\left(c, b, k \cdot \left(j \cdot -27\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 4 \cdot 10^{-97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 53.7% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(c, b, k \cdot \left(j \cdot -27\right)\right)\\ t_2 := k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+151}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma c b (* k (* j -27.0)))) (t_2 (* k (* j 27.0))))
   (if (<= t_2 -5e+151)
     t_1
     (if (<= t_2 4e-97)
       (fma b c (* -4.0 (* x i)))
       (if (<= t_2 2e+244) (* -4.0 (fma a t (* x i))) t_1)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = fma(c, b, (k * (j * -27.0)));
	double t_2 = k * (j * 27.0);
	double tmp;
	if (t_2 <= -5e+151) {
		tmp = t_1;
	} else if (t_2 <= 4e-97) {
		tmp = fma(b, c, (-4.0 * (x * i)));
	} else if (t_2 <= 2e+244) {
		tmp = -4.0 * fma(a, t, (x * i));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(c, b, Float64(k * Float64(j * -27.0)))
	t_2 = Float64(k * Float64(j * 27.0))
	tmp = 0.0
	if (t_2 <= -5e+151)
		tmp = t_1;
	elseif (t_2 <= 4e-97)
		tmp = fma(b, c, Float64(-4.0 * Float64(x * i)));
	elseif (t_2 <= 2e+244)
		tmp = Float64(-4.0 * fma(a, t, Float64(x * i)));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(c * b + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+151], t$95$1, If[LessEqual[t$95$2, 4e-97], N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+244], N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, k \cdot \left(j \cdot -27\right)\right)\\
t_2 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-97}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+244}:\\
\;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5.0000000000000002e151 or 2.00000000000000015e244 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6474.4

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites74.4%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} + j \cdot \left(k \cdot -27\right) \]
      12. *-commutativeN/A

        \[\leadsto \color{blue}{c \cdot b} + j \cdot \left(k \cdot -27\right) \]
      13. lower-fma.f6474.4

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, j \cdot \left(k \cdot -27\right)\right)} \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      16. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(j \cdot k\right) \cdot -27}\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      19. lower-*.f6474.4

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
    7. Applied rewrites74.4%

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

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

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(-27 \cdot j\right) \cdot k}\right) \]
      3. lower-*.f6474.4

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(-27 \cdot j\right)} \cdot k\right) \]
    9. Applied rewrites74.4%

      \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(-27 \cdot j\right) \cdot k}\right) \]

    if -5.0000000000000002e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.00000000000000014e-97

    1. Initial program 88.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6481.1

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites81.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
      2. lower-*.f6458.5

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\left(i \cdot x\right)}\right) \]
    8. Applied rewrites58.5%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]

    if 4.00000000000000014e-97 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000015e244

    1. Initial program 88.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6482.1

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites82.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      4. distribute-lft-inN/A

        \[\leadsto j \cdot \left(-27 \cdot k\right) + \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      8. distribute-lft-inN/A

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

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(i \cdot x + a \cdot t\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
      12. lower-*.f6475.3

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{a \cdot t}\right)\right) \]
    8. Applied rewrites75.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)} \]
    9. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -4 \cdot \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)} \]
      3. lower-*.f6458.2

        \[\leadsto -4 \cdot \mathsf{fma}\left(a, t, \color{blue}{i \cdot x}\right) \]
    11. Applied rewrites58.2%

      \[\leadsto \color{blue}{-4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -5 \cdot 10^{+151}:\\ \;\;\;\;\mathsf{fma}\left(c, b, k \cdot \left(j \cdot -27\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 4 \cdot 10^{-97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c, b, k \cdot \left(j \cdot -27\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 53.8% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)\\ t_2 := k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+151}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma c b (* -27.0 (* j k)))) (t_2 (* k (* j 27.0))))
   (if (<= t_2 -5e+151)
     t_1
     (if (<= t_2 4e-97)
       (fma b c (* -4.0 (* x i)))
       (if (<= t_2 2e+244) (* -4.0 (fma a t (* x i))) t_1)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = fma(c, b, (-27.0 * (j * k)));
	double t_2 = k * (j * 27.0);
	double tmp;
	if (t_2 <= -5e+151) {
		tmp = t_1;
	} else if (t_2 <= 4e-97) {
		tmp = fma(b, c, (-4.0 * (x * i)));
	} else if (t_2 <= 2e+244) {
		tmp = -4.0 * fma(a, t, (x * i));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(c, b, Float64(-27.0 * Float64(j * k)))
	t_2 = Float64(k * Float64(j * 27.0))
	tmp = 0.0
	if (t_2 <= -5e+151)
		tmp = t_1;
	elseif (t_2 <= 4e-97)
		tmp = fma(b, c, Float64(-4.0 * Float64(x * i)));
	elseif (t_2 <= 2e+244)
		tmp = Float64(-4.0 * fma(a, t, Float64(x * i)));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(c * b + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+151], t$95$1, If[LessEqual[t$95$2, 4e-97], N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+244], N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)\\
t_2 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-97}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+244}:\\
\;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5.0000000000000002e151 or 2.00000000000000015e244 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6474.4

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites74.4%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} + j \cdot \left(k \cdot -27\right) \]
      12. *-commutativeN/A

        \[\leadsto \color{blue}{c \cdot b} + j \cdot \left(k \cdot -27\right) \]
      13. lower-fma.f6474.4

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, j \cdot \left(k \cdot -27\right)\right)} \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      16. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(j \cdot k\right) \cdot -27}\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      19. lower-*.f6474.4

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
    7. Applied rewrites74.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)} \]

    if -5.0000000000000002e151 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.00000000000000014e-97

    1. Initial program 88.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6481.1

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites81.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
      2. lower-*.f6458.5

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\left(i \cdot x\right)}\right) \]
    8. Applied rewrites58.5%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]

    if 4.00000000000000014e-97 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000015e244

    1. Initial program 88.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6482.1

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites82.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      4. distribute-lft-inN/A

        \[\leadsto j \cdot \left(-27 \cdot k\right) + \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      8. distribute-lft-inN/A

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

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(i \cdot x + a \cdot t\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
      12. lower-*.f6475.3

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{a \cdot t}\right)\right) \]
    8. Applied rewrites75.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)} \]
    9. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -4 \cdot \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)} \]
      3. lower-*.f6458.2

        \[\leadsto -4 \cdot \mathsf{fma}\left(a, t, \color{blue}{i \cdot x}\right) \]
    11. Applied rewrites58.2%

      \[\leadsto \color{blue}{-4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -5 \cdot 10^{+151}:\\ \;\;\;\;\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 4 \cdot 10^{-97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 52.2% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+185}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* k (* j 27.0))))
   (if (<= t_1 -1e+185)
     (* j (* k -27.0))
     (if (<= t_1 4e-97)
       (fma b c (* -4.0 (* x i)))
       (if (<= t_1 2e+244) (* -4.0 (fma a t (* x i))) (* k (* j -27.0)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = k * (j * 27.0);
	double tmp;
	if (t_1 <= -1e+185) {
		tmp = j * (k * -27.0);
	} else if (t_1 <= 4e-97) {
		tmp = fma(b, c, (-4.0 * (x * i)));
	} else if (t_1 <= 2e+244) {
		tmp = -4.0 * fma(a, t, (x * i));
	} else {
		tmp = k * (j * -27.0);
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(k * Float64(j * 27.0))
	tmp = 0.0
	if (t_1 <= -1e+185)
		tmp = Float64(j * Float64(k * -27.0));
	elseif (t_1 <= 4e-97)
		tmp = fma(b, c, Float64(-4.0 * Float64(x * i)));
	elseif (t_1 <= 2e+244)
		tmp = Float64(-4.0 * fma(a, t, Float64(x * i)));
	else
		tmp = Float64(k * Float64(j * -27.0));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+185], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e-97], N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+244], N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+185}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-97}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\
\;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.9999999999999998e184

    1. Initial program 83.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in j around inf

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      5. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      6. lower-*.f6468.2

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} \]
    5. Applied rewrites68.2%

      \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} \]

    if -9.9999999999999998e184 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.00000000000000014e-97

    1. Initial program 88.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6480.8

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites80.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]
      2. lower-*.f6457.8

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\left(i \cdot x\right)}\right) \]
    8. Applied rewrites57.8%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right) \]

    if 4.00000000000000014e-97 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000015e244

    1. Initial program 88.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6482.1

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites82.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      4. distribute-lft-inN/A

        \[\leadsto j \cdot \left(-27 \cdot k\right) + \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      8. distribute-lft-inN/A

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

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(i \cdot x + a \cdot t\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
      12. lower-*.f6475.3

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{a \cdot t}\right)\right) \]
    8. Applied rewrites75.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)} \]
    9. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -4 \cdot \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)} \]
      3. lower-*.f6458.2

        \[\leadsto -4 \cdot \mathsf{fma}\left(a, t, \color{blue}{i \cdot x}\right) \]
    11. Applied rewrites58.2%

      \[\leadsto \color{blue}{-4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)} \]

    if 2.00000000000000015e244 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6484.2

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites84.2%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} + j \cdot \left(k \cdot -27\right) \]
      12. *-commutativeN/A

        \[\leadsto \color{blue}{c \cdot b} + j \cdot \left(k \cdot -27\right) \]
      13. lower-fma.f6484.1

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, j \cdot \left(k \cdot -27\right)\right)} \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      16. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(j \cdot k\right) \cdot -27}\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      19. lower-*.f6484.2

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
    7. Applied rewrites84.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)} \]
    8. Taylor expanded in c around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
      2. lower-*.f6475.7

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    10. Applied rewrites75.7%

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

        \[\leadsto \color{blue}{\left(-27 \cdot j\right) \cdot k} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(-27 \cdot j\right) \cdot k} \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot -27\right)} \cdot k \]
      4. lower-*.f6475.7

        \[\leadsto \color{blue}{\left(j \cdot -27\right)} \cdot k \]
    12. Applied rewrites75.7%

      \[\leadsto \color{blue}{\left(j \cdot -27\right) \cdot k} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification61.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -1 \cdot 10^{+185}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 4 \cdot 10^{-97}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 70.5% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\\ t_2 := \mathsf{fma}\left(j, k \cdot -27, t\_1\right)\\ t_3 := k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t\_3 \leq -4 \cdot 10^{+99}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-52}:\\ \;\;\;\;\mathsf{fma}\left(b, c, t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* -4.0 (fma i x (* t a))))
        (t_2 (fma j (* k -27.0) t_1))
        (t_3 (* k (* j 27.0))))
   (if (<= t_3 -4e+99) t_2 (if (<= t_3 5e-52) (fma b c t_1) t_2))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = -4.0 * fma(i, x, (t * a));
	double t_2 = fma(j, (k * -27.0), t_1);
	double t_3 = k * (j * 27.0);
	double tmp;
	if (t_3 <= -4e+99) {
		tmp = t_2;
	} else if (t_3 <= 5e-52) {
		tmp = fma(b, c, t_1);
	} else {
		tmp = t_2;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(-4.0 * fma(i, x, Float64(t * a)))
	t_2 = fma(j, Float64(k * -27.0), t_1)
	t_3 = Float64(k * Float64(j * 27.0))
	tmp = 0.0
	if (t_3 <= -4e+99)
		tmp = t_2;
	elseif (t_3 <= 5e-52)
		tmp = fma(b, c, t_1);
	else
		tmp = t_2;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(i * x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision] + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -4e+99], t$95$2, If[LessEqual[t$95$3, 5e-52], N[(b * c + t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\\
t_2 := \mathsf{fma}\left(j, k \cdot -27, t\_1\right)\\
t_3 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t\_3 \leq -4 \cdot 10^{+99}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-52}:\\
\;\;\;\;\mathsf{fma}\left(b, c, t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -3.9999999999999999e99 or 5e-52 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6478.8

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites78.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      4. distribute-lft-inN/A

        \[\leadsto j \cdot \left(-27 \cdot k\right) + \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      8. distribute-lft-inN/A

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

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(i \cdot x + a \cdot t\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
      12. lower-*.f6477.1

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{a \cdot t}\right)\right) \]
    8. Applied rewrites77.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)} \]

    if -3.9999999999999999e99 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5e-52

    1. Initial program 89.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6481.9

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites81.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in j around 0

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
      4. lower-*.f6479.7

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{a \cdot t}\right)\right) \]
    8. Applied rewrites79.7%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -4 \cdot 10^{+99}:\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 5 \cdot 10^{-52}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 71.1% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+185}:\\ \;\;\;\;\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+58}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, j \cdot \left(k \cdot -27\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* k (* j 27.0))))
   (if (<= t_1 -1e+185)
     (fma (* k -27.0) j (* -4.0 (* t a)))
     (if (<= t_1 2e+58)
       (fma b c (* -4.0 (fma i x (* t a))))
       (fma b c (fma -4.0 (* x i) (* j (* k -27.0))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = k * (j * 27.0);
	double tmp;
	if (t_1 <= -1e+185) {
		tmp = fma((k * -27.0), j, (-4.0 * (t * a)));
	} else if (t_1 <= 2e+58) {
		tmp = fma(b, c, (-4.0 * fma(i, x, (t * a))));
	} else {
		tmp = fma(b, c, fma(-4.0, (x * i), (j * (k * -27.0))));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(k * Float64(j * 27.0))
	tmp = 0.0
	if (t_1 <= -1e+185)
		tmp = fma(Float64(k * -27.0), j, Float64(-4.0 * Float64(t * a)));
	elseif (t_1 <= 2e+58)
		tmp = fma(b, c, Float64(-4.0 * fma(i, x, Float64(t * a))));
	else
		tmp = fma(b, c, fma(-4.0, Float64(x * i), Float64(j * Float64(k * -27.0))));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+185], N[(N[(k * -27.0), $MachinePrecision] * j + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+58], N[(b * c + N[(-4.0 * N[(i * x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+185}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(t \cdot a\right)\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, j \cdot \left(k \cdot -27\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.9999999999999998e184

    1. Initial program 83.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
      2. lower-*.f6473.3

        \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites73.3%

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
      3. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      4. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      5. *-commutativeN/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - \color{blue}{\left(27 \cdot j\right)} \cdot k \]
      6. associate-*l*N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - \color{blue}{27 \cdot \left(j \cdot k\right)} \]
      7. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) - 27 \cdot \color{blue}{\left(j \cdot k\right)} \]
      8. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right) + \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)} \]
      9. metadata-evalN/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + \color{blue}{-27} \cdot \left(j \cdot k\right) \]
      10. *-commutativeN/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      11. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(j \cdot k\right)} \cdot -27 \]
      12. associate-*r*N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      13. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot t\right) + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      14. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + -4 \cdot \left(a \cdot t\right)} \]
      15. *-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot -27\right) \cdot j} + -4 \cdot \left(a \cdot t\right) \]
      16. lower-fma.f6475.7

        \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(a \cdot t\right)\right)} \]
    7. Applied rewrites75.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(a \cdot t\right)\right)} \]

    if -9.9999999999999998e184 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999989e58

    1. Initial program 88.5%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6481.8

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites81.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in j around 0

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
      4. lower-*.f6479.1

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{a \cdot t}\right)\right) \]
    8. Applied rewrites79.1%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]

    if 1.99999999999999989e58 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 86.5%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      3. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \left(i \cdot x\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{x \cdot i}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{x \cdot i}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      12. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      14. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      16. lower-*.f6474.1

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites74.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, j \cdot \left(k \cdot -27\right)\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -1 \cdot 10^{+185}:\\ \;\;\;\;\mathsf{fma}\left(k \cdot -27, j, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+58}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(i, x, t \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, j \cdot \left(k \cdot -27\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 37.0% accurate, 1.2× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := -27 \cdot \left(j \cdot k\right)\\ t_2 := k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+99}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-97}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+58}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* -27.0 (* j k))) (t_2 (* k (* j 27.0))))
   (if (<= t_2 -4e+99)
     t_1
     (if (<= t_2 4e-97) (* b c) (if (<= t_2 2e+58) (* -4.0 (* t a)) t_1)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = -27.0 * (j * k);
	double t_2 = k * (j * 27.0);
	double tmp;
	if (t_2 <= -4e+99) {
		tmp = t_1;
	} else if (t_2 <= 4e-97) {
		tmp = b * c;
	} else if (t_2 <= 2e+58) {
		tmp = -4.0 * (t * a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (-27.0d0) * (j * k)
    t_2 = k * (j * 27.0d0)
    if (t_2 <= (-4d+99)) then
        tmp = t_1
    else if (t_2 <= 4d-97) then
        tmp = b * c
    else if (t_2 <= 2d+58) then
        tmp = (-4.0d0) * (t * a)
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = -27.0 * (j * k);
	double t_2 = k * (j * 27.0);
	double tmp;
	if (t_2 <= -4e+99) {
		tmp = t_1;
	} else if (t_2 <= 4e-97) {
		tmp = b * c;
	} else if (t_2 <= 2e+58) {
		tmp = -4.0 * (t * a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = -27.0 * (j * k)
	t_2 = k * (j * 27.0)
	tmp = 0
	if t_2 <= -4e+99:
		tmp = t_1
	elif t_2 <= 4e-97:
		tmp = b * c
	elif t_2 <= 2e+58:
		tmp = -4.0 * (t * a)
	else:
		tmp = t_1
	return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(-27.0 * Float64(j * k))
	t_2 = Float64(k * Float64(j * 27.0))
	tmp = 0.0
	if (t_2 <= -4e+99)
		tmp = t_1;
	elseif (t_2 <= 4e-97)
		tmp = Float64(b * c);
	elseif (t_2 <= 2e+58)
		tmp = Float64(-4.0 * Float64(t * a));
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = -27.0 * (j * k);
	t_2 = k * (j * 27.0);
	tmp = 0.0;
	if (t_2 <= -4e+99)
		tmp = t_1;
	elseif (t_2 <= 4e-97)
		tmp = b * c;
	elseif (t_2 <= 2e+58)
		tmp = -4.0 * (t * a);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+99], t$95$1, If[LessEqual[t$95$2, 4e-97], N[(b * c), $MachinePrecision], If[LessEqual[t$95$2, 2e+58], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-97}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+58}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -3.9999999999999999e99 or 1.99999999999999989e58 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6458.1

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites58.1%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} + j \cdot \left(k \cdot -27\right) \]
      12. *-commutativeN/A

        \[\leadsto \color{blue}{c \cdot b} + j \cdot \left(k \cdot -27\right) \]
      13. lower-fma.f6458.0

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, j \cdot \left(k \cdot -27\right)\right)} \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      16. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(j \cdot k\right) \cdot -27}\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      19. lower-*.f6458.0

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
    7. Applied rewrites58.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)} \]
    8. Taylor expanded in c around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
      2. lower-*.f6452.7

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    10. Applied rewrites52.7%

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]

    if -3.9999999999999999e99 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.00000000000000014e-97

    1. Initial program 88.9%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} \]
    4. Step-by-step derivation
      1. lower-*.f6432.0

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Applied rewrites32.0%

      \[\leadsto \color{blue}{b \cdot c} \]

    if 4.00000000000000014e-97 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999989e58

    1. Initial program 89.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
      2. lower-*.f6445.7

        \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    5. Applied rewrites45.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -4 \cdot 10^{+99}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 4 \cdot 10^{-97}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+58}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 50.2% accurate, 1.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+226}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* k (* j 27.0))))
   (if (<= t_1 -2e+226)
     (* j (* k -27.0))
     (if (<= t_1 2e+244) (* -4.0 (fma a t (* x i))) (* k (* j -27.0))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = k * (j * 27.0);
	double tmp;
	if (t_1 <= -2e+226) {
		tmp = j * (k * -27.0);
	} else if (t_1 <= 2e+244) {
		tmp = -4.0 * fma(a, t, (x * i));
	} else {
		tmp = k * (j * -27.0);
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(k * Float64(j * 27.0))
	tmp = 0.0
	if (t_1 <= -2e+226)
		tmp = Float64(j * Float64(k * -27.0));
	elseif (t_1 <= 2e+244)
		tmp = Float64(-4.0 * fma(a, t, Float64(x * i)));
	else
		tmp = Float64(k * Float64(j * -27.0));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+226], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+244], N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+226}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\
\;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.99999999999999992e226

    1. Initial program 81.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in j around inf

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      5. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      6. lower-*.f6474.3

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} \]
    5. Applied rewrites74.3%

      \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} \]

    if -1.99999999999999992e226 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000015e244

    1. Initial program 88.8%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{neg}\left(\color{blue}{\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right)}\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      5. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(b, c, \left(\mathsf{neg}\left(\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t + i \cdot x\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t + i \cdot x\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      10. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t + i \cdot x, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, \color{blue}{x \cdot i}\right), -27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. lower-*.f6480.7

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites80.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + -4 \cdot \left(a \cdot t + i \cdot x\right) \]
      4. distribute-lft-inN/A

        \[\leadsto j \cdot \left(-27 \cdot k\right) + \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) \]
      8. distribute-lft-inN/A

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

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(i \cdot x + a \cdot t\right)}\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\mathsf{fma}\left(i, x, a \cdot t\right)}\right) \]
      12. lower-*.f6461.8

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{a \cdot t}\right)\right) \]
    8. Applied rewrites61.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)} \]
    9. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto -4 \cdot \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)} \]
      3. lower-*.f6453.3

        \[\leadsto -4 \cdot \mathsf{fma}\left(a, t, \color{blue}{i \cdot x}\right) \]
    11. Applied rewrites53.3%

      \[\leadsto \color{blue}{-4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)} \]

    if 2.00000000000000015e244 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6484.2

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites84.2%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} + j \cdot \left(k \cdot -27\right) \]
      12. *-commutativeN/A

        \[\leadsto \color{blue}{c \cdot b} + j \cdot \left(k \cdot -27\right) \]
      13. lower-fma.f6484.1

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, j \cdot \left(k \cdot -27\right)\right)} \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      16. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(j \cdot k\right) \cdot -27}\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      19. lower-*.f6484.2

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
    7. Applied rewrites84.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)} \]
    8. Taylor expanded in c around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
      2. lower-*.f6475.7

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    10. Applied rewrites75.7%

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

        \[\leadsto \color{blue}{\left(-27 \cdot j\right) \cdot k} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(-27 \cdot j\right) \cdot k} \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot -27\right)} \cdot k \]
      4. lower-*.f6475.7

        \[\leadsto \color{blue}{\left(j \cdot -27\right)} \cdot k \]
    12. Applied rewrites75.7%

      \[\leadsto \color{blue}{\left(j \cdot -27\right) \cdot k} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification58.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -2 \cdot 10^{+226}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 34.2% accurate, 1.6× speedup?

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -3.9999999999999996e165

    1. Initial program 84.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in j around inf

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      5. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      6. lower-*.f6466.8

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} \]
    5. Applied rewrites66.8%

      \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} \]

    if -3.9999999999999996e165 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000015e244

    1. Initial program 88.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in i around inf

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
      2. *-commutativeN/A

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
      3. lower-*.f6433.9

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Applied rewrites33.9%

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} \]

    if 2.00000000000000015e244 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6484.2

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites84.2%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} + j \cdot \left(k \cdot -27\right) \]
      12. *-commutativeN/A

        \[\leadsto \color{blue}{c \cdot b} + j \cdot \left(k \cdot -27\right) \]
      13. lower-fma.f6484.1

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, j \cdot \left(k \cdot -27\right)\right)} \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      16. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(j \cdot k\right) \cdot -27}\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      19. lower-*.f6484.2

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
    7. Applied rewrites84.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)} \]
    8. Taylor expanded in c around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
      2. lower-*.f6475.7

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    10. Applied rewrites75.7%

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

        \[\leadsto \color{blue}{\left(-27 \cdot j\right) \cdot k} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(-27 \cdot j\right) \cdot k} \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot -27\right)} \cdot k \]
      4. lower-*.f6475.7

        \[\leadsto \color{blue}{\left(j \cdot -27\right)} \cdot k \]
    12. Applied rewrites75.7%

      \[\leadsto \color{blue}{\left(j \cdot -27\right) \cdot k} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification43.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -4 \cdot 10^{+165}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 34.2% accurate, 1.6× speedup?

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -3.9999999999999996e165

    1. Initial program 84.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in j around inf

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      3. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      5. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      6. lower-*.f6466.8

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} \]
    5. Applied rewrites66.8%

      \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} \]

    if -3.9999999999999996e165 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000015e244

    1. Initial program 88.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in i around inf

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
      2. *-commutativeN/A

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
      3. lower-*.f6433.9

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Applied rewrites33.9%

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} \]

    if 2.00000000000000015e244 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6484.2

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites84.2%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} + j \cdot \left(k \cdot -27\right) \]
      12. *-commutativeN/A

        \[\leadsto \color{blue}{c \cdot b} + j \cdot \left(k \cdot -27\right) \]
      13. lower-fma.f6484.1

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, j \cdot \left(k \cdot -27\right)\right)} \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      16. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(j \cdot k\right) \cdot -27}\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      19. lower-*.f6484.2

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
    7. Applied rewrites84.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)} \]
    8. Taylor expanded in c around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
      2. lower-*.f6475.7

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    10. Applied rewrites75.7%

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification43.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -4 \cdot 10^{+165}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 34.2% accurate, 1.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := -27 \cdot \left(j \cdot k\right)\\ t_2 := k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+165}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* -27.0 (* j k))) (t_2 (* k (* j 27.0))))
   (if (<= t_2 -4e+165) t_1 (if (<= t_2 2e+244) (* -4.0 (* x i)) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = -27.0 * (j * k);
	double t_2 = k * (j * 27.0);
	double tmp;
	if (t_2 <= -4e+165) {
		tmp = t_1;
	} else if (t_2 <= 2e+244) {
		tmp = -4.0 * (x * i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (-27.0d0) * (j * k)
    t_2 = k * (j * 27.0d0)
    if (t_2 <= (-4d+165)) then
        tmp = t_1
    else if (t_2 <= 2d+244) then
        tmp = (-4.0d0) * (x * i)
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = -27.0 * (j * k);
	double t_2 = k * (j * 27.0);
	double tmp;
	if (t_2 <= -4e+165) {
		tmp = t_1;
	} else if (t_2 <= 2e+244) {
		tmp = -4.0 * (x * i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = -27.0 * (j * k)
	t_2 = k * (j * 27.0)
	tmp = 0
	if t_2 <= -4e+165:
		tmp = t_1
	elif t_2 <= 2e+244:
		tmp = -4.0 * (x * i)
	else:
		tmp = t_1
	return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(-27.0 * Float64(j * k))
	t_2 = Float64(k * Float64(j * 27.0))
	tmp = 0.0
	if (t_2 <= -4e+165)
		tmp = t_1;
	elseif (t_2 <= 2e+244)
		tmp = Float64(-4.0 * Float64(x * i));
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = -27.0 * (j * k);
	t_2 = k * (j * 27.0);
	tmp = 0.0;
	if (t_2 <= -4e+165)
		tmp = t_1;
	elseif (t_2 <= 2e+244)
		tmp = -4.0 * (x * i);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+165], t$95$1, If[LessEqual[t$95$2, 2e+244], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+165}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+244}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -3.9999999999999996e165 or 2.00000000000000015e244 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6475.1

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites75.1%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} + j \cdot \left(k \cdot -27\right) \]
      12. *-commutativeN/A

        \[\leadsto \color{blue}{c \cdot b} + j \cdot \left(k \cdot -27\right) \]
      13. lower-fma.f6475.1

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, j \cdot \left(k \cdot -27\right)\right)} \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      16. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(j \cdot k\right) \cdot -27}\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      19. lower-*.f6475.1

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
    7. Applied rewrites75.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)} \]
    8. Taylor expanded in c around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
      2. lower-*.f6470.0

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    10. Applied rewrites70.0%

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]

    if -3.9999999999999996e165 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000015e244

    1. Initial program 88.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in i around inf

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
      2. *-commutativeN/A

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
      3. lower-*.f6433.9

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Applied rewrites33.9%

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -4 \cdot 10^{+165}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 2 \cdot 10^{+244}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 37.3% accurate, 1.6× speedup?

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

\mathbf{elif}\;t\_2 \leq 10^{+53}:\\
\;\;\;\;b \cdot c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -3.9999999999999999e99 or 9.9999999999999999e52 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.5%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6457.1

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites57.1%

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

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} + j \cdot \left(k \cdot -27\right) \]
      12. *-commutativeN/A

        \[\leadsto \color{blue}{c \cdot b} + j \cdot \left(k \cdot -27\right) \]
      13. lower-fma.f6457.1

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, j \cdot \left(k \cdot -27\right)\right)} \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      15. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      16. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(j \cdot k\right) \cdot -27}\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      19. lower-*.f6457.1

        \[\leadsto \mathsf{fma}\left(c, b, -27 \cdot \color{blue}{\left(j \cdot k\right)}\right) \]
    7. Applied rewrites57.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, -27 \cdot \left(j \cdot k\right)\right)} \]
    8. Taylor expanded in c around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
      2. lower-*.f6451.8

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    10. Applied rewrites51.8%

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]

    if -3.9999999999999999e99 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.9999999999999999e52

    1. Initial program 88.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} \]
    4. Step-by-step derivation
      1. lower-*.f6430.7

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Applied rewrites30.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -4 \cdot 10^{+99}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;k \cdot \left(j \cdot 27\right) \leq 10^{+53}:\\ \;\;\;\;b \cdot c\\ \mathbf{else}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 24.1% accurate, 11.3× speedup?

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

    \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
  2. Add Preprocessing
  3. Taylor expanded in b around inf

    \[\leadsto \color{blue}{b \cdot c} \]
  4. Step-by-step derivation
    1. lower-*.f6421.9

      \[\leadsto \color{blue}{b \cdot c} \]
  5. Applied rewrites21.9%

    \[\leadsto \color{blue}{b \cdot c} \]
  6. Add Preprocessing

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

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\ t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t\_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\ \mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t < 165.68027943805222:\\ \;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t\_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
        (t_2
         (-
          (- (* (* 18.0 t) (* (* x y) z)) t_1)
          (- (* (* k j) 27.0) (* c b)))))
   (if (< t -1.6210815397541398e-69)
     t_2
     (if (< t 165.68027943805222)
       (+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
       t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = ((a * t) + (i * x)) * 4.0;
	double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	double tmp;
	if (t < -1.6210815397541398e-69) {
		tmp = t_2;
	} else if (t < 165.68027943805222) {
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((a * t) + (i * x)) * 4.0d0
    t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
    if (t < (-1.6210815397541398d-69)) then
        tmp = t_2
    else if (t < 165.68027943805222d0) then
        tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = ((a * t) + (i * x)) * 4.0;
	double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	double tmp;
	if (t < -1.6210815397541398e-69) {
		tmp = t_2;
	} else if (t < 165.68027943805222) {
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = ((a * t) + (i * x)) * 4.0
	t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b))
	tmp = 0
	if t < -1.6210815397541398e-69:
		tmp = t_2
	elif t < 165.68027943805222:
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0)
	t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b)))
	tmp = 0.0
	if (t < -1.6210815397541398e-69)
		tmp = t_2;
	elseif (t < 165.68027943805222)
		tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j))));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = ((a * t) + (i * x)) * 4.0;
	t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	tmp = 0.0;
	if (t < -1.6210815397541398e-69)
		tmp = t_2;
	elseif (t < 165.68027943805222)
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t\_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
\mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t < 165.68027943805222:\\
\;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t\_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024219 
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, E"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< t -8105407698770699/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))) (if (< t 8284013971902611/50000000000000) (+ (- (* (* 18 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4)) (- (* c b) (* 27 (* k j)))) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))))))

  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))